FileBrowser.st
author Claus Gittinger <cg@exept.de>
Wed, 20 Jan 1999 22:51:29 +0100
changeset 1981 a9cced5a1449
parent 1976 52a84063ede3
child 1983 50157c992ef9
permissions -rw-r--r--
checkin from browser
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'
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   290
                    #layout: #(#LayoutFrame 0 0 10 0 0 1 32 0)
1933
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'
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   297
                    #layout: #(#LayoutFrame 10 0 36 0 305 0 58 0)
1933
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'
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   302
                    #layout: #(#LayoutFrame 7 0 66 0 143 0 88 0)
1933
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'
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   309
                    #layout: #(#LayoutFrame 0 0.0 107 0 0 1.0 129 0)
1933
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'
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   316
                    #layout: #(#LayoutFrame 10 0 133 0 305 0 155 0)
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   317
                    #enableChannel: #notSearchForSameContents
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   318
                    #model: #contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   319
                )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   320
                 #(#CheckBoxSpec
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   321
                    #name: 'CheckBox2'
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   322
                    #layout: #(#LayoutFrame 6 0 163 0 142 0 185 0)
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   323
                    #enableChannel: #notSearchForSameContents
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   324
                    #model: #ignoreCaseInContents
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   325
                    #label: 'Ignore case'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   326
                    #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   327
                )
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   328
                 #(#LabelSpec
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   329
                    #name: 'Label3'
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   330
                    #layout: #(#LayoutFrame 0 0.0 223 0 -30 1.0 245 0)
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   331
                    #label: 'Containing same contents as selected:'
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   332
                    #translateLabel: true
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   333
                    #adjust: #left
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   334
                )
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   335
                 #(#DividerSpec
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   336
                    #name: 'Separator1'
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   337
                    #layout: #(#LayoutFrame 0 0.0 97 0 0 1.0 101 0)
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   338
                )
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   339
                 #(#CheckToggleSpec
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   340
                    #name: 'CheckToggle1'
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   341
                    #layout: #(#LayoutOrigin -25 1 225 0)
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   342
                    #model: #searchForSameContents
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   343
                    #enableChannel: #searchForSameContentsEnabled
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   344
                    #isTriggerOnDown: true
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   345
                    #showLamp: false
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   346
                    #lampColor: #(#Color 100.0 100.0 0.0)
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   347
                )
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   348
              )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   349
          )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   350
      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   351
! !
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   352
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   353
!FileBrowser class methodsFor:'menu specs'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   354
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   355
baseDirectoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   356
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   357
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   358
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   359
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   360
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   361
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   362
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   363
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   364
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   365
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   366
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   367
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   368
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   369
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   370
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   371
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   372
          
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   373
	   #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   374
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   375
		#label: 'Copy Path'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   376
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   377
		#value: #copyPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   378
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   379
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   380
		#label: '-'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   381
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   382
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   383
		#label: 'Up'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   384
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   385
		#value: #changeToParentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   386
		#enabled: #currentDirectoryIsNotTop
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
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   389
		#label: 'Back'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   390
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   391
		#value: #changeToPreviousDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   392
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   393
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   394
		#label: 'Home'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   395
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   396
		#value: #changeToHomeDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   397
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   398
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   399
		#label: 'Default'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   400
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   401
		#value: #changeToDefaultDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   402
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   403
	     #(#MenuItem
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   404
		#label: 'Goto...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   405
		#translateLabel: true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   406
		#value: #changeCurrentDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   407
	    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   408
	  ) nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   409
	  nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   410
      )
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
    "Created: / 4.8.1998 / 17:21:16 / cg"
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   413
    "Modified: / 14.8.1998 / 19:19:06 / cg"
1834
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
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   416
directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   417
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   418
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   419
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   420
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   421
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   422
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   423
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   424
     MenuEditor new openOnClass:FileBrowser andSelector:#directoryMenuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   425
     (Menu new fromLiteralArrayEncoding:(FileBrowser directoryMenuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   426
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   427
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   428
    <resource: #programMenu>
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
    |base|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   431
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   432
    base := self baseDirectoryMenuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   433
    base := base decodeAsLiteralArray.
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
    "/ add the history items ...
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   436
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
   437
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   438
	base addItem:(MenuItem labeled:'-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   439
	DirectoryHistory do:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   440
	    base addItem:((MenuItem label:dirName value:#changeDirectoryTo:)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   441
			    argument:dirName;
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   442
			    yourself).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   443
	].
1834
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
    ^ base
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   447
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
   448
    "Modified: / 17.8.1998 / 10:13:05 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   449
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   450
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   451
menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   452
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   453
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   454
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   455
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   456
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   457
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   458
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   459
     MenuEditor new openOnClass:FileBrowser andSelector:#menuPopUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   460
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuPopUp)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   461
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   462
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   463
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   464
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   465
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   466
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   467
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   468
          
1874
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: 'Spawn'
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: #fileSpawn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   474
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   475
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   476
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   477
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   478
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   479
                #label: 'Get Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   480
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   481
                #value: #fileGet
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   482
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   483
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   484
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   485
                #label: 'Insert Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   486
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   487
                #value: #fileInsert
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   488
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   489
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   490
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   491
                #label: 'FileIn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   492
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   493
                #value: #fileFileIn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   494
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   495
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   496
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   497
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   498
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   499
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   500
                #label: 'Unix Command...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   501
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   502
                #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   503
                #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   504
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   505
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   506
                #label: 'DOS Command...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   507
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   508
                #isVisible: #systemIsDOS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   509
                #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   510
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   511
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   512
                #label: 'VMS Command...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   513
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   514
                #isVisible: #systemIsVMS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   515
                #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   516
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   517
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   518
                #label: 'ST/X Tools'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   519
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   520
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   521
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   522
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   523
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   524
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   525
                          #label: 'Changes Browser'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   526
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   527
                          #value: #openChangesBrowser
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   528
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   529
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   530
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   531
                          #label: 'Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   532
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   533
                          #value: #openEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   534
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   535
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   536
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   537
                          #label: 'HTML Reader'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   538
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   539
                          #value: #openHTMLReader
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   540
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   541
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   542
                       #(#MenuItem
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   543
                          #label: 'Applet Viewer'
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   544
                          #translateLabel: true
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   545
                          #isVisible: #hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   546
                          #value: #openAppletViewer
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   547
                          #enabled: #hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   548
                      )
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   549
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   550
                          #label: 'Image Inspect'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   551
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   552
                          #value: #openImageInspector
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   553
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   554
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   555
                       #(#MenuItem
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   556
                          #label: 'Image Preview'
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   557
                          #translateLabel: true
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   558
                          #value: #openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   559
                          #enabled: #hasSelection
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   560
                      )
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   561
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   562
                          #label: 'Image Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   563
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   564
                          #value: #openImageEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   565
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   566
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   567
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   568
                          #label: 'ZipFile Tool'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   569
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   570
                          #value: #openZipTool
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   571
                          #enabled: #hasZipFileSelected
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
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   574
                          #label: 'Hex Dump'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   575
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   576
                          #value: #fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   577
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   578
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   579
                          #label: 'Show File Differences'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   580
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   581
                          #value: #openDiffView
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: 'Terminal'
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
                          #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   587
                          #value: #openTerminal
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   588
                          #enabled: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   589
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   590
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   591
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   592
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   593
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   594
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   595
                #label: '-'
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: 'Remove...'
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: #fileRemove
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   601
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   602
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   603
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   604
                #label: 'Rename...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   605
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   606
                #value: #fileRename
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   607
                #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   608
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   609
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   610
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   611
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   612
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   613
                #label: 'New Directory...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   614
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   615
                #value: #newDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   616
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   617
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   618
                #label: 'New File...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   619
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   620
                #value: #newFile
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   621
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   622
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   623
                #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   624
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   625
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   626
                #label: 'Update'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   627
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   628
                #value: #updateCurrentDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   629
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   630
          ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   631
          nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   632
      )
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   633
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   634
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   635
menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   636
    "This resource specification was automatically generated
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   637
     by the MenuEditor of ST/X."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   638
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   639
    "Do not manually edit this!! If it is corrupted,
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   640
     the MenuEditor may not be able to read the specification."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   641
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   642
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   643
     MenuEditor new openOnClass:FileBrowser andSelector:#menuSpec
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   644
     (Menu new fromLiteralArrayEncoding:(FileBrowser menuSpec)) startUp
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   645
    "
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   646
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   647
    <resource: #menu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   648
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   649
    ^
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   650
     
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   651
       #(#Menu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   652
          
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   653
           #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   654
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   655
                #label: 'About'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   656
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   657
                #labelImage: #(#ResourceRetriever #ToolApplicationModel #menuIcon)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   658
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   659
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   660
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   661
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   662
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   663
                          #label: 'About Smalltalk/X...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   664
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   665
                          #value: #showAboutSTX
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   666
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   667
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   668
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   669
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   670
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   671
                          #label: 'About FileBrowser...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   672
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   673
                          #value: #openAboutThisApplication
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   674
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   675
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   676
                    nil
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
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   679
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   680
                #label: 'File'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   681
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   682
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   683
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   684
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   685
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   686
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   687
                          #label: 'Open'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   688
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   689
                          #value: #menuOpen
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   690
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   691
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   692
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   693
                          #label: 'FileIn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   694
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   695
                          #value: #fileFileIn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   696
                          #enabled: #hasSelection
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: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   700
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   701
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   702
                          #label: 'New'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   703
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   704
                          #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   705
                           #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   706
                              
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   707
                               #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   708
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   709
                                    #label: 'Directory...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   710
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   711
                                    #value: #newDirectory
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
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   714
                                    #label: 'File...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   715
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   716
                                    #value: #newFile
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   717
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   718
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   719
                                    #label: 'Hard Link...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   720
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   721
                                    #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   722
                                    #value: #newHardLink
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   723
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   724
                                 #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   725
                                    #label: 'Symbolic Link...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   726
                                    #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   727
                                    #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   728
                                    #value: #newSoftLink
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   729
                                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   730
                              ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   731
                              nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   732
                          )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   733
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   734
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   735
                          #label: 'Remove'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   736
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   737
                          #value: #fileRemove
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   738
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   739
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   740
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   741
                          #label: 'Rename'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   742
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   743
                          #value: #fileRename
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   744
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   745
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   746
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   747
                          #label: 'Properties...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   748
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   749
                          #value: #fileGetLongInfo
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   750
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   751
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   752
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   753
                          #label: '-'
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   754
                          #isVisible: #javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   755
                      )
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   756
                       #(#MenuItem
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   757
                          #label: 'Add to Java ClassPath'
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   758
                          #translateLabel: true
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   759
                          #isVisible: #javaSupportLoaded
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   760
                          #value: #fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   761
                          #enabled: #canAddToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   762
                      )
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   763
                       #(#MenuItem
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   764
                          #label: 'Remove from Java ClassPath'
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   765
                          #translateLabel: true
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   766
                          #isVisible: #javaSupportLoaded
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   767
                          #value: #fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   768
                          #enabled: #canRemoveToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   769
                      )
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   770
                       #(#MenuItem
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
   771
                          #label: '-'
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   772
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   773
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   774
                          #label: 'Spawn'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   775
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   776
                          #value: #fileSpawn
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   777
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   778
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   779
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   780
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   781
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   782
                          #label: 'Exit'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   783
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   784
                          #value: #menuExit
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   785
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   786
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   787
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   788
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   789
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   790
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   791
                #label: 'Directory'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   792
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   793
                #submenuChannel: #directoryMenuSpec
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   794
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   795
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   796
                #label: 'Edit'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   797
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   798
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   799
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   800
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   801
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   802
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   803
                          #label: 'Get Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   804
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   805
                          #value: #fileGet
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   806
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   807
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   808
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   809
                          #label: 'Insert Contents'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   810
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   811
                          #value: #fileInsert
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   812
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   813
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   814
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   815
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   816
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   817
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   818
                          #label: 'Copy File List'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   819
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   820
                          #value: #copyFileList
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   821
                      )
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   822
                       #(#MenuItem
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   823
                          #label: 'Copy Selected Filename'
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   824
                          #translateLabel: true
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   825
                          #value: #copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   826
                      )
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   827
                       #(#MenuItem
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   828
                          #label: 'Copy Command History'
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   829
                          #translateLabel: true
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   830
                          #value: #copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   831
                      )
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   832
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   833
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   834
                )
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: 'View'
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
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   840
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   841
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   842
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   843
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   844
                          #label: 'Details'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   845
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   846
                          #indication: #showingDetails
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: 'Show Hidden Files'
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
                          #indication: #showingHiddenFiles
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   852
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   853
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   854
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   855
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   856
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   857
                          #label: 'Sort By Name'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   858
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   859
                          #choice: #sortByWhat
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   860
                          #choiceValue: #name
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   861
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   862
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   863
                          #label: 'Sort By Type'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   864
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   865
                          #choice: #sortByWhat
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   866
                          #choiceValue: #type
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: 'Sort By Time'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   870
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   871
                          #choice: #sortByWhat
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   872
                          #choiceValue: #time
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   873
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   874
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   875
                          #label: 'Ignore Case'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   876
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   877
                          #enabled: #sortByName
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   878
                          #indication: #sortCaseless
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: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   882
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   883
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   884
                          #label: 'Encoding...'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   885
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   886
                          #value: #fileEncoding
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   887
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   888
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   889
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   890
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   891
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   892
                          #label: 'Update'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   893
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   894
                          #value: #updateCurrentDirectory
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   895
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   896
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   897
                    nil
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
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   900
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   901
                #label: 'Tools'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   902
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   903
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   904
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
   905
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   906
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   907
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   908
                          #label: 'Unix Command'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   909
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   910
                          #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   911
                          #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   912
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   913
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   914
                          #label: 'DOS Command'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   915
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   916
                          #isVisible: #systemIsDOS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   917
                          #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   918
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   919
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   920
                          #label: 'VMS Command'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   921
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   922
                          #isVisible: #systemIsVMS
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   923
                          #value: #menuOSCommand
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   924
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   925
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   926
                          #label: '-'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   927
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   928
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   929
                          #label: 'Changes Browser'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   930
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   931
                          #value: #openChangesBrowser
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   932
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   933
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   934
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   935
                          #label: 'Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   936
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   937
                          #value: #openEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   938
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   939
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   940
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   941
                          #label: 'HTML Reader'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   942
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   943
                          #value: #openHTMLReader
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   944
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   945
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   946
                       #(#MenuItem
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   947
                          #label: 'Applet Viewer'
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   948
                          #translateLabel: true
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   949
                          #isVisible: #hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   950
                          #value: #openAppletViewer
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   951
                          #enabled: #hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   952
                      )
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   953
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   954
                          #label: 'Image Inspector'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   955
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   956
                          #value: #openImageInspector
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   957
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   958
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   959
                       #(#MenuItem
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   960
                          #label: 'Image Preview'
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   961
                          #translateLabel: true
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   962
                          #value: #openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   963
                          #enabled: #hasSelection
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   964
                      )
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
   965
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   966
                          #label: 'Image Editor'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   967
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   968
                          #value: #openImageEditor
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   969
                          #enabled: #hasSelection
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   970
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   971
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   972
                          #label: 'ZipFile Tool'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   973
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   974
                          #value: #openZipTool
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   975
                          #enabled: #hasZipFileSelected
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: 'File Differences...'
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
                          #value: #openDiffView
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   981
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   982
                       #(#MenuItem
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   983
                          #label: 'Find Duplicate Files'
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   984
                          #translateLabel: true
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   985
                          #value: #fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   986
                      )
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
   987
                       #(#MenuItem
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
   988
                          #label: 'Find All Duplicate Files (recursive)'
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
   989
                          #translateLabel: true
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
   990
                          #value: #fileFindAllDuplicates
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
   991
                      )
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
   992
                       #(#MenuItem
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   993
                          #label: 'Find a File'
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   994
                          #translateLabel: true
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   995
                          #value: #fileFindFile
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   996
                      )
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   997
                       #(#MenuItem
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   998
                          #label: 'Hex Dump'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
   999
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1000
                          #value: #fileHexDump
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
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1003
                          #label: 'Shell Terminal'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1004
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1005
                          #isVisible: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1006
                          #value: #openTerminal
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1007
                          #enabled: #systemIsUnix
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1008
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1009
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1010
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1011
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1012
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1013
             #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1014
                #label: 'Help'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1015
                #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1016
                #startGroup: #right
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1017
                #submenu: 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1018
                 #(#Menu
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1019
                    
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1020
                     #(
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1021
                       #(#MenuItem
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1022
                          #label: 'FileBrowser Documentation'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1023
                          #translateLabel: true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1024
                          #value: #openHTMLDocument:
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1025
                          #argument: 'tools/fbrowser/TOP.html'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1026
                      )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1027
                    ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1028
                    nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1029
                )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1030
            )
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1031
          ) nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1032
          nil
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1033
      )
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1034
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1035
    "Modified: / 28.11.1998 / 17:48:35 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1036
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1037
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1038
!FileBrowser methodsFor:'aspects'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1039
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1040
canAddToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1041
    ^ [ |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1042
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1043
        (Java isNil or:[Java isLoaded not]) ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1044
            false
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1045
        ] ifFalse:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1046
            f := self getSelectedFileName.
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1047
            f notNil ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1048
                f := currentDirectory asFilename construct:f
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1049
            ].
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1050
            f notNil
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1051
            and:[(Java classPath includes:f pathName) not
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1052
            and:[f isDirectory
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1053
                 or:[(f hasSuffix:'jar')
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1054
                 or:[(f hasSuffix:'zip')]]]].
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1055
        ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1056
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1057
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1058
    "Modified: / 22.9.1998 / 16:56:40 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1059
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1060
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1061
canRemoveToClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1062
    ^ [ |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1063
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1064
        (Java isNil or:[Java isLoaded not]) ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1065
            false
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1066
        ] ifFalse:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1067
            f := self getSelectedFileName.
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1068
            f notNil ifTrue:[
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1069
                f := currentDirectory asFilename construct:f
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1070
            ].
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1071
            f notNil
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1072
            and:[(Java classPath includes:f pathName)
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1073
            and:[f isDirectory
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1074
                 or:[(f hasSuffix:'jar')
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1075
                 or:[(f hasSuffix:'zip')]]]]
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1076
          ]
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1077
      ]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1078
1894
b7b2f4b09bf0 oops - check if Java isLoaded.
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  1079
    "Modified: / 22.9.1998 / 16:57:16 / cg"
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1080
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1081
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1082
currentDirectoryIsNotTop
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1083
    ^ [currentDirectory notNil and:[currentDirectory isRootDirectory not]]
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
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1086
    "Created: / 14.8.1998 / 12:07:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1087
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1088
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1089
hasJava
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1090
    ^ [ JavaClassReader notNil 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1091
        and:[JavaClassReader isLoaded]]
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1092
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1093
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1094
    "Created: / 17.10.1998 / 22:58:25 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1095
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1096
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1097
hasJavaAndSelection
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1098
    ^ [ fileListView selection size > 0
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1099
        and:[JavaClassReader notNil 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1100
        and:[JavaClassReader isLoaded]]]
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1101
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1102
    "Modified: / 17.10.1998 / 16:57:14 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1103
    "Created: / 17.10.1998 / 22:58:03 / cg"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1104
!
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  1105
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1106
hasSelection
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1107
    ^ [fileListView selection size > 0]
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1108
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1109
    "Created: / 4.8.1998 / 14:10:31 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1110
    "Modified: / 4.8.1998 / 14:10:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1111
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1112
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1113
hasVisitHistory
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1114
    ^ [DirectoryHistory size > 0]
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1115
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1116
    "Created: / 14.8.1998 / 19:17:02 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1117
    "Modified: / 14.8.1998 / 19:17:17 / cg"
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1118
!
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  1119
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1120
hasZipFileSelected
1976
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1121
    ^ [|sel fn suff|
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1122
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1123
        sel := fileListView selectionValue.
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1124
        sel size == 1 ifTrue:[
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1125
            suff := self getSelectedFileName asFilename suffix asLowercase.
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1126
            suff = 'zip' or:[suff = 'jar']
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1127
        ] ifFalse:[
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1128
            false
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1129
        ]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1130
      ]
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1131
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1132
    "Created: / 26.8.1998 / 16:15:26 / cg"
1976
52a84063ede3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1975
diff changeset
  1133
    "Modified: / 30.12.1998 / 18:35:38 / cg"
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1134
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  1135
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1136
javaSupportLoaded
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1137
    ^ [ JavaClassReader notNil 
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1138
        and:[JavaClassReader isLoaded]]
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1139
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1140
    "Created: / 9.11.1998 / 05:33:17 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1141
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1142
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1143
showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1144
    ^ showingDetails
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1145
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1146
    "Created: / 14.8.1998 / 14:15:15 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1147
!
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
showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1150
    ^ showingHiddenFiles
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1151
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1152
    "Created: / 14.8.1998 / 14:15:44 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1153
!
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
sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1156
    ^ sortByWhat
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1157
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1158
    "Created: / 14.8.1998 / 15:55:18 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1159
    "Modified: / 14.8.1998 / 15:56:08 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1160
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1161
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1162
sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1163
    ^ sortCaseless
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1164
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1165
    "Created: / 14.8.1998 / 14:21:21 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1166
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1167
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1168
systemIsDOS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1169
    ^ OperatingSystem isMSDOSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1170
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1171
    "Created: / 4.8.1998 / 13:37:28 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1172
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1173
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1174
systemIsUnix
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1175
    ^ OperatingSystem isUNIXlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1176
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1177
    "Created: / 4.8.1998 / 13:37:13 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1178
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1179
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1180
systemIsVMS
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1181
    ^ OperatingSystem isVMSlike
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1182
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1183
    "Created: / 4.8.1998 / 13:37:37 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1184
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1185
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1186
!FileBrowser methodsFor:'drag & drop'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1187
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1188
canDrop:aCollectionOfDropObjects
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1189
    "I accept fileObjects only"
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1190
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1191
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1192
	aDropObject isFileObject ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1193
	    aDropObject isTextObject ifFalse:[^ false].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1194
	]
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1195
    ].
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1196
    ^ true
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1197
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1198
    "Modified: 11.4.1997 / 12:41:59 / cg"
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1199
!
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1200
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1201
drop:aCollectionOfDropObjects at:aPoint
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1202
    "handle drops"
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1203
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1204
    aCollectionOfDropObjects do:[:aDropObject |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1205
	self dropSingleObject:aDropObject at:aPoint
1132
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1206
    ]
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1207
bd2eda432e1d drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1208
    "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
  1209
!
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1210
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1211
dropSingleObject:someObject at:aPoint
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1212
    "handle drops; if its a directory, change to it.
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1213
     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
  1214
     If its text, paste it into the codeView."
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1215
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1216
    |newDir newFile|
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1217
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1218
    someObject isFileObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1219
	someObject isDirectory ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1220
	    newDir := someObject theObject pathName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1221
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1222
	    newDir := someObject theObject directoryName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1223
	    newFile := someObject theObject baseName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1224
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1225
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1226
	newDir notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1227
	    newDir ~= currentDirectory pathName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1228
		self changeDirectoryTo:newDir.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1229
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1230
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1231
	newFile notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1232
	    newFile ~= currentFileName ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1233
		fileListView selection:(fileList indexOf:newFile).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1234
		self doFileGet:false.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1235
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1236
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1237
	^ self
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1238
    ].
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  1239
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1240
    someObject isTextObject ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1241
	subView paste:someObject theObject.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1242
	^ self
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1243
    ].
1124
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1244
517149e3924d dropped text is pasted
Claus Gittinger <cg@exept.de>
parents: 1122
diff changeset
  1245
    "Modified: 6.4.1997 / 14:46:44 / cg"
1119
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1246
! !
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1247
032300b7f247 comments
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  1248
!FileBrowser methodsFor:'events'!
1118
9fe7905c9768 drop support
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  1249
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1250
handlesKeyPress:key inView:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1251
    "this method is reached via delegation: are we prepared to handle
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1252
     a keyPress in some other view ?"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1253
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1254
    <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
  1255
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1256
    view == fileListView ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1257
	(key == #Delete 
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1258
	or:[key == #BackSpace
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1259
	or:[key == #Accept
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1260
	or:[key == #CmdI
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1261
	or:[key == #CmdF
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1262
	or:[key == #CmdD
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1263
	or:[key == #Cmdu
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1264
	or:[key == #InspectIt
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1265
	or:[key == #GotoLine
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1266
	or:[key == #DoIt]]]]]]]]]) ifTrue:[^ true].
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1267
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1268
    ^ false
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1269
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1270
    "Created: / 28.1.1997 / 14:03:20 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1271
    "Modified: / 20.6.1997 / 16:35:01 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1272
    "Modified: / 16.1.1998 / 16:50:39 / stefan"
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
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1275
keyPress:key x:x y:y view:view
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1276
    "this method is reached via delegation from the fileListView"
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1277
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1278
    <resource: #keyboard (#GotoLine #InspectIt #CmdI #Cmdu #DoIt #Delete #BackSpace #Accept)>
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1279
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1280
    (key == #Delete or:[key == #BackSpace]) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1281
	self fileRemove.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1282
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1283
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1284
    (key == #Accept) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1285
	self fileFileIn.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1286
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1287
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1288
    (key == #GotoLine) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1289
	self fileGet.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1290
	^ self
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
    (key == #DoIt) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1293
	self fileExecute.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1294
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1295
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1296
    (key == #InspectIt) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1297
	self fileGetInfo.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1298
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1299
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1300
    (key == #CmdI) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1301
	self fileGetLongInfo.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1302
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1303
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1304
    (key == #Cmdu) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1305
	self updateCurrentDirectory.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1306
	^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1307
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1308
    (key == #CmdF) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1309
	self newFile.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1310
	^ self
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1311
    ].
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1312
    (key == #CmdD) ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1313
	self newDirectory.
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  1314
	^ self
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1315
    ].
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1316
    fileListView keyPress:key x:x y:y
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1317
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1318
    "Created: / 28.1.1997 / 14:03:56 / stefan"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1319
    "Modified: / 20.6.1997 / 16:35:08 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  1320
    "Modified: / 16.1.1998 / 16:51:38 / stefan"
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1321
!
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  1322
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1323
mapped 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1324
    super mapped.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1325
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1326
     whant to know about changed history
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1327
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1328
    self updateCurrentDirectory
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
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1331
visibilityChange:how
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1332
    |wasVisible|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1333
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1334
    wasVisible := shown.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1335
    super visibilityChange:how.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1336
    (wasVisible not and:[shown]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1337
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1338
	 start checking again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1339
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1340
	Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1341
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1342
    ]
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1343
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1344
    "Modified: / 18.2.1998 / 17:57:44 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1345
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1346
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1347
!FileBrowser methodsFor:'fileList user interaction'!
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
changeDisplayMode
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1350
    "toggle from long to short listing (and vice-versa)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1351
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1352
    showingDetails value:(showingDetails value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1353
    "/ showLongList := showLongList not.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  1354
    self showOrHideTabView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1355
    self updateCurrentDirectory
747
a50e8643c666 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
  1356
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1357
    "Modified: / 4.8.1998 / 13:43:54 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1358
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1359
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1360
changeDotFileVisibility
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1361
    "turn on/off visibility of files whose name starts with '.'"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1362
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1363
    showingHiddenFiles value:(showingHiddenFiles value not).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1364
    "/ showDotFiles := showDotFiles not.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1365
    self updateCurrentDirectory
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1366
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1367
    "Modified: / 4.8.1998 / 13:45:46 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1368
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1369
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1370
detailsSettingChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1371
    "invoked, when detail (i.e. long / short) listing flag changed"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1372
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1373
    self showOrHideTabView.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1374
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1375
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1376
    "Modified: / 4.8.1998 / 13:43:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  1377
    "Created: / 14.8.1998 / 14:17:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1378
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1379
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1380
fileDoubleClick:lineNr
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1381
    "double click on a file - get its contents"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1382
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1383
    self fileSelect:lineNr.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1384
    self fileGet:true
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1385
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  1386
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1387
fileEncoding
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1388
    "open a dialog to allow change of the files character encoding.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1389
     Files are converted to internal encoding when read, and converted back
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1390
     to this encoding when saved.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1391
     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
  1392
     the internal encoding (which is iso8859).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1393
     Notice: currently, not too many encodings are supported by the system."
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1394
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1395
    |dialog list descr encodings encodingNames idx|
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1396
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1397
    list := SelectionInList new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1398
495
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1399
    descr := CharacterArray supportedExternalEncodings.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1400
    encodings := descr at:2.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1401
    encodingNames := descr at:1.
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1402
6d6a6b8feb2b ask characterArray for encodings
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1403
    list list:encodingNames.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1404
    list selectionIndex:(encodings indexOf:fileEncoding ifAbsent:1).
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1405
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1406
    dialog := Dialog new.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1407
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1408
    dialog addTextLabel:(resources string:'ENCODING_MSG') withCRs.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1409
    dialog addVerticalSpace.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1410
    dialog addListBoxOn:list withNumberOfLines:5.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1411
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1412
    dialog addAbortButton; addOkButton.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1413
    dialog open.
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1414
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1415
    dialog accepted ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1416
	idx := list selectionIndex.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1417
	fileEncoding := encodings at:idx.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1418
	subView externalEncoding:fileEncoding.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1419
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1420
	self validateFontEncodingFor:fileEncoding ask:true.
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1421
    ].
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1422
1219
8495da2ea4cf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  1423
    "Modified: 30.6.1997 / 14:41:12 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1424
!
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  1425
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1426
fileExecute
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1427
    "if text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1428
     otherwise pop up execute box immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1429
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1430
    |action sel fileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1431
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
     this replaces everything by the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1434
    "
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1435
    action := [:command | 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1436
		self class addToCommandHistory:command for:fileName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1437
		self doExecuteCommand:command replace:true
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1438
	      ].
172
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
    (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
  1441
	      yesButton:'execute') ifFalse:[^ self].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1442
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1443
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1444
"/     this inserts the commands output ...
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1445
"/    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1446
"/    action := [:command| self doExecuteCommand:command replace:false].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1447
"/
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1448
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1449
    sel := fileListView selection.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1450
    sel size == 1 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  1451
	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
  1452
    ].
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  1453
    self askForCommandFor:fileName thenDo:action
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1454
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  1455
    "Modified: 14.11.1996 / 14:59:34 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1456
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1457
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1458
fileFileIn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1459
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1460
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1461
    self fileFileInLazy:false 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1462
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1463
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1464
fileFileInLazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1465
    "fileIn the selected file(s). Do a quick load (no compilation)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1466
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1467
    self fileFileInLazy:true 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1468
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1469
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1470
fileFileInLazy:lazy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1471
    "fileIn the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1472
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1473
    |aStream path oldPath wasLazy bos prevCurrentFileName|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1474
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1475
    self selectedFilesDo:[:fileName |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1476
	path := currentDirectory filenameFor:fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1477
	path type == #regular ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1478
	    prevCurrentFileName := currentFileInFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1479
	    currentFileInFileName := fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1480
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1481
	    (ObjectFileLoader notNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1482
	    and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1483
		Object abortSignal catch:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1484
		    |p|
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
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1487
		    "/ look if already loaded ...  then unload first
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1488
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1489
		    p := path pathName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1490
		    (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1491
			(Dialog confirm:(resources 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1492
					    string:'%1 is already loaded; load anyway ?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1493
					    with:p)) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1494
			    ^ self
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
			Transcript showCR:'unloading old ' , p , ' ...'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1497
			ObjectFileLoader unloadObjectFile:p. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1498
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1499
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1500
		    Transcript showCR:'loading ' , p , ' ...'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1501
		    ObjectFileLoader loadObjectFile:p.
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
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1504
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1505
		(path hasSuffix:'cls') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1506
		    aStream := path readStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1507
		    aStream notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1508
			bos := BinaryObjectStorage onOld:aStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1509
			Class nameSpaceQuerySignal 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1510
			    answer:Smalltalk
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1511
			    do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1512
				bos next.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1513
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1514
			bos close
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1515
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1516
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1517
		    ((path hasSuffix:'class')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1518
		    or:[(path hasSuffix:'cla')]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1519
			JavaClassReader notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1520
			    JavaClassReader loadFile:(path pathName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1521
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1522
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1523
			aStream := path readStream.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1524
			aStream notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1525
			    [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1526
				Class withoutUpdatingChangesDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1527
				    oldPath := Smalltalk systemPath.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1528
				    Smalltalk systemPath:(oldPath copy addFirst:currentDirectory pathName; yourself).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1529
				    wasLazy := Compiler compileLazy:lazy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1530
				    aStream fileIn.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1531
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1532
				Class addInfoRecord:('fileIn ' , fileName) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1533
			    ] valueNowOrOnUnwindDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1534
				Compiler compileLazy:wasLazy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1535
				Smalltalk systemPath:oldPath.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1536
				aStream close
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1537
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1538
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1539
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1540
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1541
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1542
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1543
	currentFileInFileName := prevCurrentFileName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1544
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1545
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1546
    "Modified: / 19.9.1997 / 23:42:22 / stefan"
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  1547
    "Modified: / 18.6.1998 / 15:30:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1548
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1549
1972
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1550
fileFindAllDuplicates
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1551
    "scan directory and all subdirs for duplicate files"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1552
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1553
    |fileNames dir infoDir filesBySize
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1554
     result info dirPrefix|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1555
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1556
    (self askIfModified:'contents has not been saved.\\Modifications will be lost when you proceed.'
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1557
              yesButton:'proceed') ifFalse:[^ self].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1558
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1559
    self withWaitCursorDo:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1560
        result := Dictionary new.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1561
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1562
        dir := currentDirectory asFilename.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1563
        self label:myName , '- gathering file names ...'.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1564
        fileNames := dir recursiveDirectoryContents.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1565
        fileNames := fileNames collect:[:fn | dir construct:fn].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1566
        fileNames := fileNames select:[:fn | fn isDirectory not].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1567
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1568
        self label:myName , '- gathering sizes ...'.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1569
        infoDir := Dictionary new.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1570
        fileNames do:[:fn |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1571
            infoDir at:fn put:(fn fileSize)
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1572
        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1573
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1574
        "/ for each, get the files size.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1575
        "/ in a first pass, look for files of the same size and
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1576
        "/ compare them ...
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1577
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1578
        self label:myName , '- preselect possible duplicates ...'.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1579
        filesBySize := Dictionary new.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1580
        infoDir keysAndValuesDo:[:fn :sz |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1581
            |entry|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1582
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1583
            entry := filesBySize at:sz ifAbsentPut:[Set new].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1584
            entry add:fn.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1585
        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1586
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1587
        "/ any of same size ?
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1588
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1589
        self label:myName , '- checking for duplicates ...'.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1590
        filesBySize do:[:entry |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1591
            |files|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1592
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1593
            entry size > 1 ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1594
                files := entry asArray.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1595
                1 to:files size-1 do:[:idx1 |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1596
                    idx1+1 to:files size do:[:idx2 |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1597
                        |fn1 fn2|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1598
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1599
                        fn1 := files at:idx1.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1600
                        fn2 := files at:idx2.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1601
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1602
"/                        self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1603
                        (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1604
                            "/ compare the files
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1605
                            (fn1 sameContentsAs:fn2) ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1606
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1607
                                result at:fn1 put:fn2.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1608
                            ]
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1609
                        ]
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1610
                    ]
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1611
                ]
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1612
            ]
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1613
        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1614
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1615
        self label:myName , '- sorting ...'.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1616
        dirPrefix := currentDirectory asFilename pathName.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1617
        result := result associations.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1618
        result := result collect:[:assoc |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1619
                                        |f1 f2|
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1620
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1621
                                        f1 := assoc key name.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1622
                                        f2 := assoc value name.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1623
                                        (f1 startsWith:dirPrefix) ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1624
                                            f1 := f1 copyFrom:dirPrefix size + 2.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1625
                                        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1626
                                        (f2 startsWith:dirPrefix) ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1627
                                            f2 := f2 copyFrom:dirPrefix size + 2.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1628
                                        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1629
                                        f1 < f2 ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1630
                                            f2 -> f1
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1631
                                        ] ifFalse:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1632
                                            f1 -> f2
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1633
                                        ]
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1634
                                ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1635
        result sort:[:f1 :f2 | f2 value < f1 value].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1636
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1637
        info := OrderedCollection new.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1638
        result do:[:assoc |
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1639
            info add:(assoc key , ' same as ' , assoc value)
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1640
        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1641
        info isEmpty ifTrue:[
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1642
            info := 'No duplicate files found.'
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1643
        ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1644
    ].
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1645
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1646
    subView contents:info.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1647
    self label:myName.
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1648
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1649
    "Created: / 28.11.1998 / 17:47:53 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1650
    "Modified: / 10.12.1998 / 17:13:14 / cg"
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1651
!
0458592bba46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1969
diff changeset
  1652
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1653
fileFindDuplicates
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1654
    "scan directory for duplicate files"
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1655
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1656
    |fileNames dir infoDir filesBySize
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1657
     result info|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1658
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1659
    (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
  1660
              yesButton:'proceed') ifFalse:[^ self].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1661
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1662
    self withWaitCursorDo:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1663
        result := Dictionary new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1664
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1665
        dir := currentDirectory asFilename.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1666
        fileNames := dir directoryContents.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1667
        fileNames := fileNames collect:[:fn | dir construct:fn].
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1668
        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
  1669
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1670
        infoDir := Dictionary new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1671
        fileNames do:[:fn |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1672
            infoDir at:fn put:(fn info)
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1673
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1674
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1675
        "/ for each, get the files size.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1676
        "/ 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
  1677
        "/ compare them ...
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1678
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1679
        filesBySize := Dictionary new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1680
        infoDir keysAndValuesDo:[:fn :info |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1681
            |sz entry|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1682
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1683
            sz := info size.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1684
            entry := filesBySize at:sz ifAbsentPut:[Set new].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1685
            entry add:fn.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1686
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1687
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1688
        "/ any of same size ?
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1689
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1690
        filesBySize do:[:entry |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1691
            |files|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1692
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1693
            entry size > 1 ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1694
                files := entry asArray.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1695
                1 to:files size-1 do:[:idx1 |
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1696
                    idx1+1 to:files size do:[:idx2 |
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  1697
                        |fn1 fn2|
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1698
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1699
                        fn1 := files at:idx1.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1700
                        fn2 := files at:idx2.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1701
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1702
                        (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1703
                            "/ compare the files
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  1704
                            (fn1 sameContentsAs:fn2) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1705
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  1706
                                result at:fn1 put:fn2.
1962
b3355227e9da when searching for duplicate files,
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
  1707
                            ]
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1708
                        ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1709
                    ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1710
                ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1711
            ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1712
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1713
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1714
        result := result associations.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1715
        result := result collect:[:assoc |
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1716
                                        |f1 f2|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1717
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1718
                                        f1 := assoc key baseName.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1719
                                        f2 := assoc value baseName.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1720
                                        f1 < f2 ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1721
                                            f2 -> f1
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1722
                                        ] ifFalse:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1723
                                            f1 -> f2
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1724
                                        ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1725
                                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1726
        result sort:[:f1 :f2 | f2 value < f1 value].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1727
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1728
        info := OrderedCollection new.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1729
        result do:[:assoc |
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1730
            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
  1731
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1732
        info isEmpty ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1733
            info := 'No duplicate files found.'
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1734
        ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1735
    ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1736
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1737
    subView contents:info
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1738
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1739
    "Created: / 3.10.1998 / 17:59:00 / cg"
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  1740
    "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
  1741
!
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  1742
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1743
fileFindFile
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1744
    |sel bindings
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1745
     namePatternHolder contentsPatternHolder
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1746
     ignoreCaseInName ignoreCaseInContents
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1747
     namePattern contentsPattern 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1748
     searchForSameContentsEnabled searchForSameContents|
1933
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
    (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
  1751
              yesButton:'proceed') ifFalse:[^ self].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1752
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1753
    subView contents:nil; scrollToTop.
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
    bindings := IdentityDictionary new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1756
    bindings at:#namePatternHolder put:(namePatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1757
    bindings at:#contentsPatternHolder put:(contentsPatternHolder := '' asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1758
    bindings at:#ignoreCaseInName put:(ignoreCaseInName := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1759
    bindings at:#ignoreCaseInContents put:(ignoreCaseInContents := false asValue).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1760
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1761
    searchForSameContentsEnabled := false.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1762
    sel := fileListView selectionValue.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1763
    sel size == 1 ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1764
        searchForSameContentsEnabled := true.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1765
        sel := sel first string withoutSeparators
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1766
    ].
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1767
    bindings at:#searchForSameContentsEnabled put:(searchForSameContentsEnabled := searchForSameContentsEnabled asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1768
    bindings at:#searchForSameContents put:(searchForSameContents := false asValue).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1769
    bindings at:#notSearchForSameContents put:(BlockValue forLogicalNot:searchForSameContents).
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1770
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1771
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1772
    (SimpleDialog new 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1773
        openFor:self
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1774
        interfaceSpec:(self class fileSearchDialogSpec)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1775
        withBindings:bindings) ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1776
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1777
        namePattern := namePatternHolder value.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1778
        namePattern size == 0 ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1779
            namePattern := nil
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1780
        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1781
            ignoreCaseInName value ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1782
                namePattern := namePattern asLowercase
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1783
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1784
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1785
        contentsPattern := contentsPatternHolder value.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1786
        contentsPattern size == 0 ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1787
            contentsPattern := nil
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1788
        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1789
            ignoreCaseInContents value ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1790
                contentsPattern := contentsPattern asLowercase
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1791
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1792
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1793
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1794
        self withWaitCursorDo:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1795
            |stopSignal access myProcess lowerFrameView|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1796
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1797
            myProcess := Processor activeProcess.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1798
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1799
            access := Semaphore forMutualExclusion name:'accessLock'.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1800
            stopSignal := Signal new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1801
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1802
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1803
             The following is tricky: 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1804
             the pauseToggle & killButton will
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1805
             be handled by their own windowGroup process.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1806
             This means, that they respond to events even though
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1807
             I myself am reading the commands output.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1808
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1809
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1810
            commandView beInvisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1811
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1812
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1813
             must take kill & pauseButtons out of my group
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1814
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1815
            killButton windowGroup:nil.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1816
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1817
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1818
             bring them to front, and turn hidden-mode off
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1819
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1820
            killButton label:(resources string:'stop').
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1821
            killButton raise; beVisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1822
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1823
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1824
             kill will make me raise the stopSignal when pressed
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1825
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1826
            killButton 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1827
                action:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1828
                    access critical:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1829
                        myProcess interruptWith:[stopSignal raiseRequest].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1830
                    ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1831
                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1832
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1833
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1834
             start kill button under its own windowgroup
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1835
            "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1836
            killButton openAutonomous.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1837
            killButton windowGroup process processGroupId:(Processor activeProcess id).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1838
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1839
            lowerFrameView := subView superView.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1840
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1841
            [
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1842
                stopSignal catch:[
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1843
                    searchForSameContents value ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1844
                        self 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1845
                            doFindFileNamed:namePattern
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1846
                            ignoreCase:ignoreCaseInName value
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1847
                            containingString:contentsPattern
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1848
                            ignoreCaseInContents:ignoreCaseInContents value
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1849
                            sameContentsAsFile:(currentDirectory asFilename construct:sel) 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1850
                            sameContentsAs:nil 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1851
                            in:currentDirectory.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1852
                    ] ifFalse:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1853
                        self 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1854
                            doFindFileNamed:namePattern
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1855
                            ignoreCase:ignoreCaseInName value
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1856
                            containingString:contentsPattern
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1857
                            ignoreCaseInContents:ignoreCaseInContents value
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1858
                            sameContentsAsFile:nil 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1859
                            sameContentsAs:nil 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1860
                            in:currentDirectory.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  1861
                    ]
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1862
                ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1863
            ] valueNowOrOnUnwindDo:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1864
                |wg|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1865
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1866
                self label:myName; iconLabel:myName.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1867
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1868
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1869
                 hide the button, and make sure it will stay
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1870
                 hidden when we are realized again
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1871
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1872
                killButton beInvisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1873
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1874
                commandView beVisible.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1875
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1876
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1877
                 remove the killButton from its group
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1878
                 (otherwise, it will be destroyed when we shut down the group)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1879
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1880
                wg := killButton windowGroup.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1881
                killButton windowGroup:nil.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1882
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1883
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1884
                 shut down the kill buttons windowgroup
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1885
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1886
                wg notNil ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1887
                    wg process terminate.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1888
                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1889
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1890
                 clear its action (actually not needed, but
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1891
                 releases reference to thisContext earlier)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1892
                "
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1893
                killButton action:nil.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1894
                killButton label:(resources string:'kill').
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1895
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1896
                "/    
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1897
                "/ allow interaction with the codeView
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1898
                "/ (bring it back into my group)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1899
                "/
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1900
                lowerFrameView windowGroup:(self windowGroup).
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1901
            ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1902
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1903
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1904
        self label:myName.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1905
        currentFileName isNil ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1906
            subView modified:false.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1907
        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1908
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1909
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1910
    "Created: / 15.10.1998 / 11:32:57 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1911
    "Modified: / 15.10.1998 / 12:41:09 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1912
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1913
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1914
fileGet
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1915
    "get contents of selected file into subView.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1916
     If text was modified show a queryBox,
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1917
     otherwise get it immediately"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1918
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1919
    self fileGet:false
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1920
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1921
    "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
  1922
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1923
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1924
fileGet:viaDoubleClick
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1925
    "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
  1926
     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
  1927
     otherwise get it immediately"
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1928
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1929
    |fileName msg label|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1930
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  1931
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1932
	self doFileGet:viaDoubleClick.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1933
	^ self
1110
9ec4692e9cda dont decode string, if the encoding is already iso8859
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
  1934
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1935
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1936
    fileName notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1937
	(currentDirectory filenameFor:fileName) isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1938
	    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
  1939
	    label := 'change'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1940
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1941
	    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
  1942
	    label := 'get'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1943
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1944
	(self ask:(resources at:msg) yesButton:label) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1945
	    subView modified:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1946
	    self doFileGet:viaDoubleClick
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  1947
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1948
    ]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1949
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  1950
    "Created: 19.6.1996 / 09:38:35 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1951
    "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
  1952
    "Modified: 18.9.1997 / 16:27:34 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1953
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1954
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1955
fileGetInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1956
    "show short file (stat)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1957
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1958
    self fileGetInfo:false
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1959
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1960
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1961
fileGetInfo:longInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1962
    "get info on selected file - show it in a box"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1963
1672
9df905f8bfa3 update fileInfo while showing infoBox
Claus Gittinger <cg@exept.de>
parents: 1628
diff changeset
  1964
    |string box updater|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1965
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1966
    string := self getFileInfoString:longInfo.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1967
    string notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1968
	box := InfoBox title:string.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1969
	updater := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1970
	    [true] whileTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1971
		Delay waitForSeconds:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1972
		string := self getFileInfoString:longInfo.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1973
		box title:string
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1974
	    ] 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1975
	] fork.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1976
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1977
	box showAtPointer.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1978
	updater terminate.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1979
	box destroy
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1980
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1981
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1982
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1983
fileGetLongInfo
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1984
    "show long stat (file)-info"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1985
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1986
    self fileGetInfo:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1987
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  1988
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1989
fileHexDump
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1990
    "show a hex dump (similar to od -x)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1991
     Only needed with non-Unix systems."
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1992
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1993
    self withReadCursorDo:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1994
        |fileName f stream data offs 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1995
         addrDigits col line asciiLine lines|
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1996
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1997
        fileName := self getSelectedFileName.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1998
        fileName notNil ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  1999
            f := currentDirectory construct:fileName.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2000
            f isDirectory ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2001
                ^ self warn:(resources string:'%1 is a directory.' with:fileName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2002
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2003
            f exists ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2004
                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
  2005
                ^ self
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2006
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2007
            f isReadable ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2008
                self warn:(resources string:'''%1'' is unreadable.' with:fileName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2009
                ^ self
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2010
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2011
            stream := f readStream binary.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2012
            data := stream contents.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2013
            stream close.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2014
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2015
            subView list:nil.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2016
            col := 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2017
            offs := 0.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2018
            lines := StringCollection new.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2019
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2020
            addrDigits := ((f fileSize + 1) log:16) truncated + 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2021
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2022
            line := (offs hexPrintString:addrDigits) , ': '.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2023
            asciiLine := ''.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2024
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2025
            data do:[:byte |
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2026
                line := line , (byte hexPrintString:2).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2027
                (byte between:32 and:127) ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2028
                    asciiLine := asciiLine copyWith:(Character value:byte)
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2029
                ] ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2030
                    asciiLine := asciiLine , '.'
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2031
                ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2032
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2033
                offs := offs + 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2034
                col := col + 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2035
                col > 16 ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2036
                    lines add:(line , '        ' , asciiLine).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2037
                    (offs bitAnd:16rFF) == 0 ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2038
                        lines add:nil
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2039
                    ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2040
                    line := (offs hexPrintString:addrDigits) , ': '.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2041
                    asciiLine := ''.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2042
                    col := 1.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2043
                ] ifFalse:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2044
                    line := line , ' '
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2045
                ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2046
            ].
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2047
            line := line paddedTo:(3*16 + addrDigits + 1).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2048
            lines add:(line , '        ' , asciiLine).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2049
            self show:lines.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2050
        ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2051
    ]
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2052
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2053
    "Modified: / 7.9.1998 / 15:37:47 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2054
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2055
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2056
fileInsert
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2057
    "insert contents of file at the cursor position"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2058
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2059
    |fileName|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2060
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2061
    fileName := self getSelectedFileName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2062
    fileName notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2063
	self showFile:fileName insert:true encoding:fileEncoding
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2064
    ]
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  2065
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2066
    "Modified: 23.4.1997 / 13:06:06 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2067
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2068
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2069
fileListMenu
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2070
    "return the menu to show in the fileList"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2071
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  2072
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2073
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2074
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2075
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2076
    m := self class menuPopUp.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2077
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2078
    m receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2079
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2080
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2081
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2082
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2083
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2084
fileListMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2085
    "return the menu to show in the fileList"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2086
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2087
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2088
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2089
    |items m sel ns subMenu subItems|
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2090
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2091
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2092
		 ('spawn'            fileSpawn        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2093
		 ('-'                nil              )  
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2094
		 ('get contents'     fileGet          GotoLine)      
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2095
		 ('insert contents'  fileInsert       )            
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2096
		 ('show info'        fileGetInfo      InspectIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2097
		 ('show full info'   fileGetLongInfo  CmdI)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2098
	       ).
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2099
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2100
    ((ns := Project current defaultNameSpace) notNil 
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2101
    and:[ns ~~ Smalltalk]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2102
	items := items copyWith:(Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2103
				    with:(resources string:'fileIn (into ''%1'')' with:(Project current defaultNameSpace name))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2104
				    with:#fileFileIn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2105
				    with:#Accept)
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2106
                                
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2107
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2108
	items := items copyWith:#( 'fileIn'  #fileFileIn  #Accept)
1193
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2109
    ].
568b858d94ce show current namespace in menus fileIn item
Claus Gittinger <cg@exept.de>
parents: 1189
diff changeset
  2110
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2111
    items := items , #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2112
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2113
		 ('update'                    updateCurrentDirectory    Cmdu)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2114
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2115
		 ('execute unix command ...'  fileExecute               DoIt)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2116
		 ('st/x tools'                stxTools                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2117
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2118
		 ('remove'                    fileRemove                Delete)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2119
		 ('rename ...'                fileRename                )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2120
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2121
		 ('display long list'         changeDisplayMode         )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2122
		 ('show all files'            changeDotFileVisibility   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2123
		 ('encoding ...'              fileEncoding              )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2124
		 ('-'                                                   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2125
		 ('create directory ...'      newDirectory              CmdD)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2126
		 ('create file ...'           newFile                   CmdF)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2127
	       ).             
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2128
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2129
    m := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2130
	    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2131
	    resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2132
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2133
    showingHiddenFiles value "showDotFiles" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2134
	m labelAt:#changeDotFileVisibility put:(resources string:'hide hidden files')
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2135
    ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2136
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2137
	m labelAt:#changeDisplayMode put:(resources string:'display short list')
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
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2140
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2141
			      ('Changes browser'       openChangesBrowser  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2142
			      ('Editor'                openEditor          )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2143
			      ('HTML reader'           openHTMLReader      )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2144
			      ('Image inspect'         openImageInspector  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2145
			      ('show file differences' openDiffView        )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2146
		  ).
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2147
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2148
    OperatingSystem isUNIXlike ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2149
	items := items , #( ('terminal'              openTerminal )).
1751
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2150
    ].
c42e758e842d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  2151
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2152
    JavaInterpreter notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2153
	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
  2154
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2155
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2156
    m subMenuAt:#stxTools 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2157
	    put:(PopUpMenu
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2158
		    itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2159
		    resources:resources).
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2160
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2161
    ((sel := fileListView selection) isNil 
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2162
    or:[sel isEmpty]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2163
	m disableAll:#(fileGet fileInsert
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2164
		       fileGetInfo fileGetLongInfo
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2165
		       fileFileIn fileFileInLazy
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2166
		       fileRemove fileRename).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2167
	(m subMenuAt:#stxTools)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2168
	    disableAll:#(openChangesBrowser openEditor openHTMLReader openImageInspector)
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2169
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2170
	fileListView selection size > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2171
	    m disableAll:#( fileGet fileInsert fileGetInfo fileGetLongInfo fileRename )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2172
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2173
    ].
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
    ^m
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2176
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2177
    "Modified: / 16.1.1998 / 16:42:59 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2178
    "Modified: / 4.8.1998 / 13:45:56 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2179
    "Created: / 13.8.1998 / 20:51:38 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2180
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2181
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2182
filePrint
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2183
    "send a files contents to the printer (not in the menu)"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2184
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2185
    |fileName path inStream printStream line|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2186
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2187
    self withWaitCursorDo:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2188
	fileName := self getSelectedFileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2189
	fileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2190
	    path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2191
	    (path type == #regular) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2192
		inStream := path readStream.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2193
		inStream isNil ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2194
		    printStream := PrinterStream new.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2195
		    printStream notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2196
			[inStream atEnd] whileFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2197
			    line := inStream nextLine.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2198
			    printStream nextPutLine:line.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2199
			].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2200
			printStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2201
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2202
		    inStream close
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2203
		]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2204
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2205
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2206
	0 "compiler hint"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2207
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  2208
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2209
    "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
  2210
    "Modified: 18.9.1997 / 16:29:17 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2211
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2212
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2213
fileRemove
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2214
    "remove the selected file(s).
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2215
     Query if user really wants to remove the file.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2216
     - should be enhanced, to look for a ~/.trash directory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2217
     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
  2218
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2219
    |sel q|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2220
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2221
    sel := fileListView selectionValue.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2222
    sel notNil ifTrue:[
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2223
        sel := sel collect:[:rawName | 
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2224
            |nm|
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2225
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2226
            nm := rawName string.
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2227
            nm notNil ifTrue:[
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2228
                (nm endsWith:' ...') ifTrue:[
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2229
                    nm := (nm copyWithoutLast:4) withoutSpaces
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2230
                ].
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2231
            ].
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2232
            nm
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2233
        ].
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2234
        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
  2235
        sel size > 1 ifTrue:[
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2236
            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
  2237
        ] ifFalse:[
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  2238
            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
  2239
        ].
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2240
        (self sensor shiftDown
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2241
        or:[self ask:q yesButton:'remove']) ifTrue:[
1981
a9cced5a1449 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1976
diff changeset
  2242
            self withCursor:(Cursor wait) do:[
a9cced5a1449 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1976
diff changeset
  2243
                self doRemove:sel
a9cced5a1449 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1976
diff changeset
  2244
            ]
1901
94c5ad84d0e3 if shift is pressed, dont ask for remove-confirmation.
Claus Gittinger <cg@exept.de>
parents: 1894
diff changeset
  2245
        ]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2246
    ]
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2247
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  2248
    "Modified: / 16.12.1998 / 17:30:31 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2249
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2250
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2251
fileRename
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2252
    "rename the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2253
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2254
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2255
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2256
    queryBox := FilenameEnterBox new.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2257
    queryBox okText:(resources at:'rename').
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2258
    self selectedFilesDo:[:oldName |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2259
	queryBox title:(resources string:'rename ''%1'' to:' with:oldName).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2260
	queryBox initialText:oldName.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2261
	queryBox action:[:newName | self doRename:oldName to:newName].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2262
	queryBox showAtPointer
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2263
    ]
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2264
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2265
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2266
fileSelect:lineNr
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2267
    "selected a file - do nothing here"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2268
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2269
    ^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2270
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2271
    "Modified: 23.4.1997 / 13:04:55 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2272
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2273
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2274
fileSpawn
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2275
    "start another FileBrowser on the selected directory or
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2276
     on the same directory if none is selected."
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2277
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2278
    |any path|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2279
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2280
    any := false.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2281
    self selectedFilesDo:[:fileName |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2282
	path := currentDirectory filenameFor:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2283
	path isDirectory ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2284
	    self class openOn:(path pathName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2285
	    any := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2286
	]
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2287
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2288
    any ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2289
	self class openOn:currentDirectory pathName
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2290
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2291
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2292
    "Modified: 18.9.1997 / 16:32:39 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2293
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2294
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2295
loadImageAndPerform:aSelectorOrBlock
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2296
    |img path|
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2297
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2298
    self selectedFilesDo:[:fileName |
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2299
        path := currentDirectory filenameFor:fileName.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2300
        path isDirectory ifFalse:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2301
            img := Image fromFile:(path pathName).
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2302
            img notNil ifTrue:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2303
                aSelectorOrBlock isSymbol ifTrue:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2304
                    img perform:aSelectorOrBlock
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2305
                ] ifFalse:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2306
                    aSelectorOrBlock value:img
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2307
                ]
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2308
            ] ifFalse:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2309
                self warn:'unknown format: ' , fileName
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2310
            ]
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2311
        ]
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2312
    ].
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2313
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2314
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2315
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2316
    "Created: / 26.8.1998 / 16:20:18 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2317
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2318
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2319
newDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2320
    "ask for and create a new directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2321
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2322
    |queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2323
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2324
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2325
		    title:(resources at:'create new directory:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2326
		    okText:(resources at:'create')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2327
		    action:[:newName | self doCreateDirectory:newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2328
    queryBox showAtPointer
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2329
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2330
    "Modified: 23.4.1997 / 13:04:27 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2331
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2332
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2333
newFile
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2334
    "ask for and create a new file"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2335
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2336
    |sel queryBox|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2337
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2338
    queryBox := FilenameEnterBox 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2339
		    title:(resources at:'create new file:') withCRs
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2340
		    okText:(resources at:'create')
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2341
		    action:[:newName | newName isEmpty ifFalse:[self doCreateFile:newName]].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2342
    sel := subView selection.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2343
    sel notNil ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2344
	queryBox initialText:(sel asString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2345
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2346
    queryBox showAtPointer
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  2347
1396
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2348
    "Modified: / 23.4.1997 / 13:04:38 / cg"
b3c5684935ba Fix file list accelerators.
Stefan Vogel <sv@exept.de>
parents: 1393
diff changeset
  2349
    "Modified: / 16.1.1998 / 16:54:00 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2350
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2351
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2352
newHardLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2353
    "ask for and create a hard link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2354
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2355
    |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
  2356
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2357
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2358
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2359
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2360
    (sel size > 0) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2361
	(currentDirectory construct:sel) isDirectory ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2362
	    orgName1 := sel
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2363
	]
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2364
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2365
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2366
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2367
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2368
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2369
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2370
    (box addTextLabel:'Create hard link from:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2371
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2372
    (box addTextLabel:'to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2373
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2374
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2375
    box addAbortButton; addOkButton.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2376
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2377
    orgName1 size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2378
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2379
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2380
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2381
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2382
    box accepted ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2383
	name1 := name1 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2384
	(name1 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2385
	    err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2386
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2387
	    f1 := name1 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2388
	    name2 := name2 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2389
	    (name2 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2390
		err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2391
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2392
		f2 := name2 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2393
		f2 exists ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2394
		    err := '''%2'' already exists'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2395
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2396
		    f1 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2397
			err := '''%1'' does not exist'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2398
		    ] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2399
			f1 isDirectory ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2400
			    err := '''%1'' is a directory'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2401
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2402
			    ErrorSignal handle:[:ex |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2403
				err := ex errorString
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2404
			    ] do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2405
				OperatingSystem createHardLinkFrom:name1 to:name2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2406
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2407
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2408
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2409
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2410
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2411
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2412
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2413
	err notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2414
	    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
  2415
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2416
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2417
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2418
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2419
    "Modified: / 13.8.1998 / 21:47:01 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2420
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2421
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2422
newSoftLink
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2423
    "ask for and create a soft link (unix only)"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2424
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2425
    |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
  2426
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2427
    sel := self getSelectedFileName.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2428
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2429
    orgName1 := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2430
    (sel size > 0) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2431
	orgName1 := sel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2432
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2433
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2434
    name1 := orgName1 asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2435
    name2 := '' asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2436
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2437
    box := DialogBox new.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2438
    (box addTextLabel:'Create symbolic link to:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2439
    if1 := box addFilenameInputFieldOn:name1 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2440
    (box addTextLabel:'as:') adjust:#left.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2441
    if2 := box addFilenameInputFieldOn:name2 in:here tabable:true.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2442
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2443
    box addAbortButton; addOkButton.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2444
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2445
    orgName1 size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2446
	box focusOnField:if2.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2447
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2448
    box showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2449
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2450
    box accepted ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2451
	name1 := name1 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2452
	(name1 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2453
	    err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2454
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2455
	    f1 := name1 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2456
	    name2 := name2 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2457
	    (name2 size == 0) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2458
		err := 'no name entered'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2459
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2460
		f2 := name2 asFilename.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2461
		f2 exists ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2462
		    err := '''%2'' already exists'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2463
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2464
		    f1 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2465
			err := '''%1'' does not exist (link created anyway)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2466
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2467
		    ErrorSignal handle:[:ex |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2468
			err := ex errorString
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2469
		    ] do:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2470
			OperatingSystem createSymbolicLinkFrom:name1 to:name2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2471
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2472
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2473
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2474
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2475
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2476
	err notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2477
	    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
  2478
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2479
	].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2480
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2481
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2482
    "Modified: / 13.8.1998 / 21:26:59 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2483
    "Created: / 13.8.1998 / 21:47:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2484
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2485
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2486
openAppletViewer
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2487
    |numItems|
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2488
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2489
    (numItems := fileListView selection size) > 2 ifTrue:[
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2490
        (self 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2491
            confirm:(resources string:'open for each of the %1 items ?' 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2492
                                 with:numItems)) ifFalse:[^ self].
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2493
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2494
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2495
    Java startupJavaSystem.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2496
"/    Java markAllClassesUninitialized.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2497
"/    Java initAllStaticFields.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2498
"/    Java initAllClasses.
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2499
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2500
    self selectedFilesDo:[:fileName |
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2501
        |p path|
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2502
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2503
        path := currentDirectory filenameFor:fileName.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2504
        path isDirectory ifFalse:[
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2505
            p := Java 
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2506
                    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2507
                    argumentString:path pathName.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2508
            p resume.
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2509
        ]
1286
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2510
    ].
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2511
1942
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2512
    "Modified: / 18.9.1997 / 17:00:59 / stefan"
19cea4360a53 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
  2513
    "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
  2514
!
2a464093d865 added 'open applet viewer' to ST/X tools menu
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  2515
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2516
openChangesBrowser
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2517
    "open a change browser on the selected file(s)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2518
1939
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2519
    self openTool:(UserPreferences current changesBrowserClass)
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2520
5947fefec5af care for newChangesBrowser setting
Claus Gittinger <cg@exept.de>
parents: 1933
diff changeset
  2521
    "Modified: / 17.10.1998 / 14:39:15 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2522
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2523
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2524
openDiffView
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2525
    "open a diff-view"
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2526
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2527
    |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
  2528
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2529
    sel := self getSelectedFileName.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2530
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2531
    orgName1 := ''.
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2532
    (sel size > 0
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2533
    and:[lastFileDiffDirectory notNil
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2534
    and:[lastFileDiffDirectory asFilename isDirectory]]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2535
	f := lastFileDiffDirectory asFilename construct:sel.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2536
	(f exists
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2537
	and:[f isReadable]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2538
	    orgName1 := f name
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2539
	]
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2540
    ].
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2541
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2542
    name1 := orgName1 asValue.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2543
    name2 := self getSelectedFileName asValue.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2544
    here := currentDirectory pathName.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2545
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2546
    box := DialogBox new.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2547
    (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
  2548
    box addFilenameInputFieldOn:name1 in:here tabable:true.
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2549
    (box addTextLabel:'and file2:') adjust:#left.
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2550
    box addFilenameInputFieldOn:name2 in:here tabable:true.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2551
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2552
    box addAbortButton; addOkButton.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2553
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2554
    box showAtPointer.
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2555
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2556
    box accepted ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2557
	name1 := name1 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2558
	(name1 isNil or:[name1 isEmpty]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2559
	    text1 := subView contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2560
	    name1 := nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2561
	    l1 := 'browser contents'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2562
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2563
	    name1 := currentDirectory filenameFor:name1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2564
	    name1 isReadable ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2565
		nm := name1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2566
		name1 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2567
		    err := '%1 does not exist'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2568
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2569
		    err := '%1 is not readable'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2570
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2571
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2572
	    l1 := name1 pathName
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
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2575
	name2 := currentDirectory filenameFor:name2 value.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2576
	err isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2577
	    name2 isReadable ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2578
		nm := name2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2579
		name2 exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2580
		    err := '%1 does not exist'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2581
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2582
		    err := '%1 is not readable'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2583
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2584
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2585
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2586
	err notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2587
	    self warn:(resources string:err with:nm pathName).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2588
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2589
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2590
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2591
	self withWaitCursorDo:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2592
	    (name1 notNil and:[name1 name ~= orgName1]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2593
		lastFileDiffDirectory := name1 directoryName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2594
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2595
	    name1 notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2596
		text1 := name1 contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2597
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2598
	    text2 := name2 contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2599
	    text1 = text2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2600
		self information:'same contents'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2601
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2602
		d := DiffTextView 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2603
			openOn:text1 label:l1
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2604
			and:text2 label:name2 pathName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2605
		d label:'file differences'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2606
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2607
	]
252
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2608
    ].
5b9377d69ab2 added file-Diff function
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  2609
1735
57ebbb06fcd7 only show an infoBox, if files have the same contents
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
  2610
    "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
  2611
    "Modified: / 18.9.1997 / 17:31:46 / stefan"
1852
45a2ae16036f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  2612
    "Modified: / 25.8.1998 / 21:11:46 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2613
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2614
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2615
openEditor
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2616
    self openTool:EditTextView
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2617
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2618
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2619
openHTMLReader
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2620
    self openTool:HTMLDocumentView ignoreDirectories:false
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2621
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2622
    "Modified: / 7.9.1998 / 21:31:58 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2623
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2624
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2625
openImageEditor
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2626
    [self loadImageAndPerform:#edit] fork
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2627
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2628
    "Modified: / 17.9.1995 / 17:41:24 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2629
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2630
    "Created: / 13.8.1998 / 22:07:09 / cg"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2631
    "Modified: / 7.9.1998 / 21:31:41 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2632
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2633
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2634
openImageInspector
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2635
    [self loadImageAndPerform:#inspect] fork
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2636
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2637
    "Modified: / 17.9.1995 / 17:41:24 / claus"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2638
    "Modified: / 18.9.1997 / 17:05:04 / stefan"
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2639
    "Modified: / 7.9.1998 / 21:31:30 / cg"
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2640
!
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2641
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2642
openImagePreview
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2643
    [self loadImageAndPerform:[:img |
1968
33b39400ebea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2644
                                |i top viewer|
33b39400ebea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2645
33b39400ebea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2646
                                top := StandardSystemView new.
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2647
1968
33b39400ebea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1966
diff changeset
  2648
                                viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top.
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2649
                                i := img.
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2650
                                top extent:200@200.
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2651
                                top label:(img fileName asFilename directoryName asFilename baseName , '/' , img fileName asFilename baseName).
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2652
                                top openAndWait.
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2653
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2654
                                (i width > 200 or:[i height > 200]) ifTrue:[
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2655
                                    i := i magnifiedPreservingRatioTo:200@200.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2656
                                ].
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2657
                                viewer image:i.
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2658
                              ].
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2659
    ] fork
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2660
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  2661
    "Modified: / 4.12.1998 / 15:49:03 / cg"
1964
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2662
!
ee92677f96af added image preview.
Claus Gittinger <cg@exept.de>
parents: 1962
diff changeset
  2663
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2664
openTerminal
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  2665
    VT100TerminalView openShellIn:currentDirectory
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2666
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2667
    "Created: / 20.7.1998 / 18:18:15 / cg"
1732
099fb9d23958 fixed #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
  2668
    "Modified: / 20.7.1998 / 18:32:28 / cg"
1731
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2669
!
e0918756a20f added #startTerminal.
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  2670
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2671
openTool:aToolClass
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2672
    "open a tool on the selected file(s)"
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2673
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2674
    self openTool:aToolClass ignoreDirectories:true
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2675
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2676
    "Modified: / 7.9.1998 / 19:32:10 / cg"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2677
!
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2678
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2679
openTool:aToolClass ignoreDirectories:ignoreDirs
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2680
    "open a tool on the selected file(s)"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2681
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2682
    |numItems path|
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2683
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2684
    aToolClass isNil ifTrue:[
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2685
        ^ self warn:'Sorry, that tool seems to be not available'.
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2686
    ].
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2687
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2688
    (numItems := fileListView selection size) > 2 ifTrue:[
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2689
        (self 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2690
            confirm:(resources string:'open for each of the %1 items ?' 
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2691
                                 with:numItems)) ifFalse:[^ self].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2692
    ].
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2693
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2694
    self selectedFilesDo:[:fileName |
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2695
        path := currentDirectory filenameFor:fileName.
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2696
        (ignoreDirs not
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2697
        or:[path isDirectory not]) ifTrue:[
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2698
            aToolClass openOn:(path pathName).
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2699
        ]
267
03885fd03d97 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 258
diff changeset
  2700
    ].
865
48395e8ecca9 remember executeCommand actions in history as well.
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
  2701
1874
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2702
    "Modified: / 18.9.1997 / 17:06:18 / stefan"
a454cdfcd470 added hexDump tool.
Claus Gittinger <cg@exept.de>
parents: 1868
diff changeset
  2703
    "Created: / 7.9.1998 / 19:31:49 / cg"
1883
befc4797175d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1879
diff changeset
  2704
    "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
  2705
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2706
1853
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2707
openZipTool
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2708
    self openTool:ZipTool
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2709
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2710
    "Created: / 26.8.1998 / 16:20:55 / cg"
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2711
!
f745e1813b22 added zipTool to tools menu
Claus Gittinger <cg@exept.de>
parents: 1852
diff changeset
  2712
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2713
showOrHideTabView
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2714
    "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
  2715
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2716
    showingDetails value "showLongList" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2717
	tabRulerView isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2718
	    self createTabRulerIn:scrollView superView.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2719
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2720
	tabRulerView beVisible.
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2721
        
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2722
	false "self is3D" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2723
	    scrollView topInset:(tabRulerView superView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2724
	    tabRulerView superView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2725
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2726
	    scrollView topInset:(tabRulerView height).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2727
	    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2728
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2729
	tabRulerView hiddenTabs:#(1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2730
	tabRulerView fixedTabs:#(1).
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2731
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2732
	tabRulerView notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2733
	    tabRulerView beInvisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2734
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2735
	scrollView topInset:0
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2736
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2737
    tabSpec := nil.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  2738
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2739
    "Created: / 19.4.1997 / 09:50:02 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2740
    "Modified: / 4.8.1998 / 13:44:14 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2741
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2742
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2743
!FileBrowser methodsFor:'help '!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2744
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2745
helpTextFor:aComponent
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2746
    |s|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2747
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2748
    aComponent == subView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2749
	s := 'HELP_SUBVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2750
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2751
    aComponent == fileListView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2752
	s := 'HELP_FILELIST'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2753
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2754
    aComponent == filterField ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2755
	s := 'HELP_FILTER'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2756
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2757
    aComponent == labelView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2758
	s := 'HELP_PATHFIELD'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2759
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2760
    aComponent == commandView ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2761
	s := 'HELP_COMMANDVIEW'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2762
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2763
    s notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2764
	^ resources string:s
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2765
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2766
    ^ nil
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2767
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2768
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2769
!FileBrowser methodsFor:'initialization'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2770
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2771
createTabRulerIn:topFrame
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2772
    |v|
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2773
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2774
    false "self is3D" ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2775
	v := View in:topFrame.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2776
	v level:-1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2777
	tabRulerView := TabSpecRuler in:v.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2778
	tabRulerView level:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2779
	v origin:(0.0@0.0) corner:(1.0@10).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2780
	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
  2781
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2782
	tabRulerView := TabSpecRuler in:topFrame.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2783
	tabRulerView origin:(0.0@0.0) corner:(1.0@10).
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2784
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2785
    tabRulerView borderWidth:0.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2786
    tabRulerView synchronousOperation:true.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2787
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2788
    "Created: / 27.7.1998 / 20:23:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2789
    "Modified: / 27.7.1998 / 20:30:10 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2790
!
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2791
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2792
currentDirectory:aDirectoryPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2793
    "set the directory to be browsed"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2794
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2795
    currentDirectory := aDirectoryPath asFilename.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2796
    self changed:#path.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2797
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2798
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2799
     tell my subview (whatever that is) to start its file-dialog
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2800
     (i.e. save-as etc.) in that directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2801
    "
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2802
    (subView respondsTo:#directoryForFileDialog:) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2803
	subView directoryForFileDialog:currentDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2804
    ]
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2805
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2806
    "Modified: 16.9.1997 / 14:56:17 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2807
    "Modified: 21.9.1997 / 11:28:49 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2808
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2809
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2810
focusSequence
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2811
    "return the sequence in which ALT-CursorRight steps focus"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2812
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2813
    |fs|
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2814
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2815
    fs := Array 
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  2816
	with:labelView
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2817
	with:filterField 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2818
	with:fileListView 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2819
	with:subView.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2820
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2821
    commandView notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2822
	fs := fs copyWith:commandView
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2823
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2824
    ^fs
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2825
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2826
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2827
initEvents
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2828
    super initEvents.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2829
    self enableEvent:#visibilityChange.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2830
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  2831
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2832
initialize
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2833
    |frame spacing halfSpacing v topFrame labelFrame filterModel
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2834
     buttonPanel img mH menuPanel|
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2835
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2836
    super initialize.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2837
819
b78a26650047 initialize fileEncoding to #iso8859
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
  2838
    fileEncoding := #iso8859.        "/ native ST/X encoding
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  2839
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2840
    "if true, will replace leading spaces by tabs on
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2841
     file write. If false, they will be written as spaces
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2842
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2843
    compressTabs := resources at:'COMPRESS_TABS' default:true.
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2844
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2845
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2846
     showing long or short by default
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2847
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2848
    "/ showLongList := resources at:'LONG_LIST' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2849
    showingDetails := (resources at:'LONG_LIST' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2850
    showingDetails onChangeSend:#detailsSettingChanged to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2851
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2852
    "
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2853
     show hidden files or not ?
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2854
    "
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2855
    "/ showDotFiles := resources at:'SHOW_DOT_FILES' default:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2856
    showingHiddenFiles := (resources at:'SHOW_DOT_FILES' default:false) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2857
    showingHiddenFiles onChangeSend:#updateCurrentDirectory to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2858
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2859
    sortByWhat := #name asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2860
    sortByWhat onChangeSend:#sortChanged to:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2861
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2862
    sortCaseless := (Filename isCaseSensitive not) asValue.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2863
    sortCaseless onChangeSend:#updateCurrentDirectory to:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2864
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2865
    lockUpdate := false.
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2866
132
claus
parents: 126
diff changeset
  2867
    CommandHistory isNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2868
        CommandHistory := OrderedCollection new.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2869
        CommandHistorySize := 50
132
claus
parents: 126
diff changeset
  2870
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2871
    DirectoryHistory isNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2872
        DirectoryHistory := OrderedCollection new.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2873
        DirectoryHistoryWhere := OrderedCollection new.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2874
        HistorySize := 15.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2875
    ].
132
claus
parents: 126
diff changeset
  2876
    commandIndex := 0.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2877
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  2878
    icons := Dictionary new.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2879
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2880
    Icons isNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2881
        self class initializeIcons
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2882
    ].
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  2883
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2884
    myName := (resources string:self class name).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2885
    self label:myName.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2886
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2887
    menuPanel := MenuPanel in:self.
1835
05dc421fee95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1834
diff changeset
  2888
    menuPanel level:1.
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2889
    menuPanel verticalLayout:false.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2890
    menuPanel receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2891
    menuPanel menu:(self pullDownMenu).
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2892
    mH := menuPanel preferredExtent y.
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2893
    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
  2894
93
claus
parents: 85
diff changeset
  2895
    labelFrame := View 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2896
                        origin:(0.0 @ mH)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2897
                        corner:(1.0 @ (font height * 1.8 + mH) rounded)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2898
                        in:self.
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
  2899
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2900
    (styleSheet name = #st80 or:[styleSheet name == #win95]) ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2901
        labelFrame level:1.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2902
"/        labelFrame rightInset:-1.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2903
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2904
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2905
    spacing := ViewSpacing.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2906
    halfSpacing := spacing // 2.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2907
1100
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2908
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2909
      checkBlock is executed by the Processor every checkDelta seconds.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2910
      We use #pushEvent: to perform the directory update
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2911
      in our windowgroups process.
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2912
    "
d9382b49c62d Use #pushEvent: for timer handling.
Stefan Vogel <sv@exept.de>
parents: 1091
diff changeset
  2913
    checkBlock := [self pushEvent:#checkIfDirectoryHasChanged].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2914
    checkDelta := resources at:'CHECK_DELTA' default:10.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2915
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  2916
    currentDirectory := Filename currentDirectory.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2917
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2918
    filterModel := '*' asValue.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2919
    filterField := EditField in:labelFrame.
1071
Claus Gittinger <cg@exept.de>
parents: 1040
diff changeset
  2920
    filterField 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2921
        origin:[((width // 4 * 3) + halfSpacing) @ (halfSpacing)]
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2922
        corner:(1.0 @ (filterField heightIncludingBorder + halfSpacing) ).
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2923
    filterField rightInset:(ViewSpacing - halfSpacing).
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2924
    filterField model:filterModel.
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2925
1846
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2926
    labelFrame corner:(1.0 @ (mH + ViewSpacing + filterField height + halfSpacing)).
6b66290db627 geometry fixes for win95 style
Claus Gittinger <cg@exept.de>
parents: 1845
diff changeset
  2927
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2928
    self initializeFilterPattern.
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2929
    filterModel onChangeSend:#filterPatternChanged to:self.
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  2930
"/    filterField leaveAction:[:key | fileListView scrollToTop. self updateCurrentDirectory].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2931
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2932
"/    labelView := Label in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2933
"/    labelView origin:(halfSpacing @ halfSpacing)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2934
"/              extent:[((width // 4 * 3) - spacing - borderWidth)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2935
"/                       @
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2936
"/                       (filterField heightIncludingBorder)
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2937
"/                       "(font height + font descent)"
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2938
"/                     ].
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2939
"/    labelView adjust:#right.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2940
"/    labelView borderWidth:0.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2941
"/    labelView model:self; menu:#labelMenu; aspect:#path; labelMessage:#path.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2942
"/    labelFrame model:self; menu:#labelMenu.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2943
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2944
    labelView := FilenameEditField in:labelFrame.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2945
    labelView 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2946
        origin:(halfSpacing @ (halfSpacing))
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2947
        extent:[((width // 4 * 3) - spacing - borderWidth)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2948
                @
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2949
                (filterField heightIncludingBorder)
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2950
                "(font height + font descent)"
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2951
               ].
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2952
    labelView menu:#labelMenu; 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2953
            aspect:#path; changeMessage:#pathChanged:.
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2954
    labelView model:self.
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  2955
    labelView backgroundColor:(labelFrame viewBackground).
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  2956
    labelFrame model:self; menu:#labelMenu.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2957
    labelView cursorType:#solidCaret; cursorTypeNoFocus:#none.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2958
    labelView level:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2959
    labelView borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2960
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2961
    killButton := Button label:(resources string:'kill') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2962
"/    killButton origin:(halfSpacing @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2963
"/               extent:(killButton width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2964
    killButton origin:(halfSpacing @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2965
    killButton topInset:(killButton height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2966
    killButton beInvisible.
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
    pauseToggle := Toggle label:(resources string:'pause') in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2969
"/    pauseToggle origin:((killButton corner x + 50) @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2970
"/                extent:(pauseToggle width @ filterField height).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2971
    pauseToggle origin:((killButton corner x + ViewSpacing + 20) @ 1.0).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2972
    pauseToggle topInset:(pauseToggle height negated).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  2973
    pauseToggle beInvisible.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2974
132
claus
parents: 126
diff changeset
  2975
    self initializeCommandViewIn:self.
claus
parents: 126
diff changeset
  2976
claus
parents: 126
diff changeset
  2977
"/    frame := VariableVerticalPanel
claus
parents: 126
diff changeset
  2978
"/                 origin:[frame borderWidth negated 
claus
parents: 126
diff changeset
  2979
"/                         @ 
claus
parents: 126
diff changeset
  2980
"/                         labelFrame height
claus
parents: 126
diff changeset
  2981
"/                         "/ (labelView height + labelView origin y + spacing)
claus
parents: 126
diff changeset
  2982
"/                        ]
claus
parents: 126
diff changeset
  2983
"/                 corner:(1.0 @ 1.0)
claus
parents: 126
diff changeset
  2984
"/                     in:self.
claus
parents: 126
diff changeset
  2985
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2986
    frame := VariableVerticalPanel origin:0.0@mH corner:1.0@1.0 in:self.
132
claus
parents: 126
diff changeset
  2987
    frame topInset:labelFrame height.
claus
parents: 126
diff changeset
  2988
    commandView notNil ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  2989
        frame bottomInset:(commandView height + spacing + spacing)
132
claus
parents: 126
diff changeset
  2990
    ].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2991
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2992
    topFrame := View in:frame.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2993
    topFrame origin:(0.0 @ 0.0) corner:(1.0 @ 0.3).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  2994
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2995
false ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2996
    self createTabRulerIn:topFrame.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  2997
].
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2998
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  2999
    scrollView := ScrollableView in:topFrame.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3000
    scrollView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3001
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3002
    fileListView := SelectionInListView new.
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3003
    scrollView scrolledView:fileListView.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3004
    fileListView action:[:lineNr | self fileSelect:lineNr].
1326
aab1605ad945 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  3005
    fileListView doubleClickAction:[:lineNr | self fileDoubleClick:lineNr].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3006
    fileListView multipleSelectOk:true.
1010
1873d0f5aa1d Add accelerator keys.
Stefan Vogel <sv@exept.de>
parents: 994
diff changeset
  3007
    fileListView delegate:self.
98
claus
parents: 93
diff changeset
  3008
    fileListView menuHolder:self; menuPerformer:self; menuMessage:#fileListMenu.
1122
970fc7e88639 support drag out of my list.
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
  3009
    fileListView allowDrag:true.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3010
    fileListView dragObjectConverter:[:obj | 
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3011
                                        |dir nm path idx|
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3012
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3013
                                        nm := obj theObject asString.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3014
                                        idx := fileListView list indexOf:nm.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3015
                                        idx == 0 ifTrue:[
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3016
                                            "/ cannot happen ...
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3017
                                            nil
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3018
                                        ] ifFalse:[
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3019
                                            nm := fileList at:idx.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3020
                                            dir := currentDirectory pathName asFilename.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3021
                                            path := dir constructString:nm.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3022
                                            DropObject newFile:path.
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3023
                                        ]
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3024
                                     ].
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3025
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3026
    "/ sigh - must be delayed - origin is not yet fixe
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3027
"/    tabRulerView leftInset:(fileListView originRelativeTo:scrollView) x.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3028
"/    self showOrHideTabView.
1102
ebea200b201b added a tabSpecRuler
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
  3029
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3030
    v := self initializeSubViewIn:frame.
132
claus
parents: 126
diff changeset
  3031
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3032
    v origin:(0.0 @ 0.3) corner:(1.0 @ 1.0).
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3033
    subView := v scrolledView.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3034
    (subView respondsTo:#directoryForFileDialog:) ifTrue:[
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3035
        subView directoryForFileDialog:currentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3036
    ].
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3037
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3038
"/    buttonPanel := HorizontalPanelView in:self.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3039
"/    buttonPanel horizontalLayout:#leftSpace.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3040
"/    buttonPanel verticalSpace:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3041
"/    "/ buttonPanel verticalLayout:#top.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3042
"/    buttonPanel borderWidth:0.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3043
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3044
"/    buttonPanel 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3045
"/        origin:(0.5 @ halfSpacing)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3046
"/        extent:[((width // 4) - spacing - borderWidth)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3047
"/                @
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3048
"/                (buttonPanel preferredExtent y max:(labelView height))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3049
"/               ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3050
"/    "/ buttonPanel level:-1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3051
"/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3052
"/    upButton := Button in:buttonPanel.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3053
"/    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
  3054
"/    upButton label:(img ? 'up').
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3055
"/    upButton action:[self changeToParentDirectory].
1328
9588cd743755 Fix kill and pause buttons.
Stefan Vogel <sv@exept.de>
parents: 1327
diff changeset
  3056
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3057
    ObjectMemory addDependent:self.
132
claus
parents: 126
diff changeset
  3058
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3059
    "Modified: / 6.9.1995 / 20:26:06 / claus"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  3060
    "Modified: / 16.9.1997 / 14:52:46 / stefan"
1879
29ad523289a0 geometry beautified
Claus Gittinger <cg@exept.de>
parents: 1874
diff changeset
  3061
    "Modified: / 30.8.1998 / 23:03:23 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3062
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3063
132
claus
parents: 126
diff changeset
  3064
initializeCommandViewIn:frame
claus
parents: 126
diff changeset
  3065
    "set up the command view - can be redefined in subclasses as empty,
claus
parents: 126
diff changeset
  3066
     if no commandView is wanted"
claus
parents: 126
diff changeset
  3067
claus
parents: 126
diff changeset
  3068
claus
parents: 126
diff changeset
  3069
    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
  3070
    commandView allInset:ViewSpacing//2.
132
claus
parents: 126
diff changeset
  3071
    commandView topInset:(commandView preferredExtent y negated - ViewSpacing).
claus
parents: 126
diff changeset
  3072
133
claus
parents: 132
diff changeset
  3073
"/    commandView contents:'** no commands which require input here **'.
132
claus
parents: 126
diff changeset
  3074
142
claus
parents: 139
diff changeset
  3075
    commandView entryCompletionBlock:[:contents |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3076
	|newString|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3077
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3078
	newString := Filename 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3079
			filenameCompletionFor:contents 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3080
			directory:currentDirectory 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3081
			directoriesOnly:false 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3082
			filesOnly:false 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3083
			ifMultiple:[:dir | commandView flash.].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3084
	commandView contents:newString.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3085
	commandView cursorToEndOfLine.
132
claus
parents: 126
diff changeset
  3086
    ].
claus
parents: 126
diff changeset
  3087
    commandView leaveAction:[:key | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3088
	|cmd nCmd empty|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3089
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3090
	(key == #CursorDown 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3091
	or:[key == #CursorUp]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3092
	    nCmd := CommandHistory size.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3093
	    nCmd == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3094
		empty := true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3095
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3096
		key == #CursorUp ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3097
		    commandIndex == nCmd ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3098
			commandView flash.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3099
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3100
		    commandIndex := (commandIndex + 1) min:nCmd
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3101
		] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3102
		    commandIndex == 1 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3103
			commandView flash.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3104
			empty := true.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3105
		    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3106
		    commandIndex := (commandIndex - 1) max:1.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3107
		].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3108
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3109
	    empty == true ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3110
		commandView contents:nil
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3111
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3112
		commandView contents:(CommandHistory at:commandIndex).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3113
	    ]        
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3114
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3115
	key == #Return ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3116
	    cmd := commandView contents.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3117
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3118
	    subView insertLine:(
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3119
				Text string:('>> ' , cmd)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3120
				     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
  3121
"/                                ColoredListEntry string:('>> ' , cmd) color:Color blue
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3122
				)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3123
		    before:(subView cursorLine).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3124
	    subView cursorDown:1.
133
claus
parents: 132
diff changeset
  3125
claus
parents: 132
diff changeset
  3126
"/            subView insertStringAtCursor:cmd.
claus
parents: 132
diff changeset
  3127
"/            subView insertCharAtCursor:(Character cr).
132
claus
parents: 126
diff changeset
  3128
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3129
	    (cmd notNil and:[cmd notEmpty]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3130
		self class addToCommandHistory:cmd for:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3131
		self doExecuteCommand:cmd replace:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3132
		commandView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3133
		commandIndex := 0
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3134
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3135
	]
132
claus
parents: 126
diff changeset
  3136
    ].
claus
parents: 126
diff changeset
  3137
133
claus
parents: 132
diff changeset
  3138
    "Modified: 7.9.1995 / 15:48:45 / claus"
1303
410aa68caf1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1298
diff changeset
  3139
    "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
  3140
    "Modified: 18.9.1997 / 16:55:01 / stefan"
132
claus
parents: 126
diff changeset
  3141
!
claus
parents: 126
diff changeset
  3142
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3143
initializeFilterPattern
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3144
    "set an initial matchpattern - can be redefined in subclasses"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3145
344
3f881dbee13a use a model for the filter field
Claus Gittinger <cg@exept.de>
parents: 333
diff changeset
  3146
    filterField model value:'*'
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3147
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3148
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3149
initializeSubViewIn:frame
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3150
    "set up the contents view - can be redefined in subclasses for
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3151
     different view types (SoundFileBrowser/ImageBrowsers etc.)"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3152
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3153
    ^ HVScrollableView for:CodeView miniScrollerH:true miniScrollerV:false in:frame.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3154
!
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3155
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3156
postRealize
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3157
    super postRealize.
1158
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3158
    self showOrHideTabView.
ea2cd788ef59 delay tabView origin setting
Claus Gittinger <cg@exept.de>
parents: 1157
diff changeset
  3159
1247
02feb2b82daa #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 1243
diff changeset
  3160
    "Created: 24.7.1997 / 18:13:46 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3161
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3162
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3163
!FileBrowser methodsFor:'menu actions'!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3164
1950
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3165
copyCommandHistory
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3166
    "copy the command history to the clipBoard"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3167
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3168
    self setTextSelection:(CommandHistory asStringCollection asString).
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3169
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3170
    "Modified: / 29.10.1998 / 12:17:14 / cg"
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3171
!
e722027ece37 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
  3172
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3173
copyFileList
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3174
    "copy fileList to the clipBoard"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3175
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3176
    self setTextSelection:(fileListView list 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3177
			      collect:[:l | |ll|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3178
					ll := l string withoutSeparators.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3179
					(ll endsWith:' ...') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3180
					    ll copyWithoutLast:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3181
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3182
					    ll
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3183
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3184
				      ]) 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3185
				asStringCollection asString.
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3186
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3187
    "Modified: / 17.8.1998 / 10:13:10 / cg"
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3188
!
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  3189
1920
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3190
copySelectedFileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3191
    "copy the selected filename to the clipBoard (for easy paste)"
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3192
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3193
    |sel fileName|
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3194
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3195
    sel := fileListView selection.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3196
    sel size == 1 ifTrue:[
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3197
        fileName := fileList at:sel first.
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3198
        self setTextSelection:fileName
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3199
    ].
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3200
!
adffddc8cfc2 added #copyFilename (to clipboard)
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  3201
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3202
menuExit
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3203
    self closeRequest
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3204
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3205
    "Created: / 4.8.1998 / 13:41:38 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3206
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3207
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3208
menuOSCommand
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3209
    self fileExecute
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3210
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3211
    "Created: / 4.8.1998 / 14:06:54 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3212
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3213
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3214
menuOpen
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3215
    "same as a double-click"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3216
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3217
    "Modified: / 4.8.1998 / 13:42:14 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3218
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3219
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3220
menuShowFileBrowserDocumentation
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3221
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3222
    "Created: / 4.8.1998 / 14:03:57 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3223
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3224
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3225
openAboutThisApplication
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3226
    "opens an about box for this application."
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3227
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3228
    |rev box myClass clsRev image msg|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3229
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3230
    rev := ''.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3231
    myClass := self class.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3232
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3233
    (clsRev := myClass revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3234
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3235
    msg := '\' withCRs , myClass name asBoldText, rev.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3236
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3237
    AboutBox isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3238
	"/ this handles bad installations of ST/X,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3239
	"/ where the AboutBox is missing.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3240
	"/ (May vanish in the future)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3241
	^ self information:msg
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3242
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3243
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3244
    box := AboutBox title:msg.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3245
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3246
    image := self class defaultIcon.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3247
    image notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3248
	box image:image
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3249
    ].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3250
    box   label:'About This Application'.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3251
    box   autoHideAfter:10 with:[].
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3252
    box   showAtPointer.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3253
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3254
    "Modified: / 14.8.1998 / 13:20:24 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3255
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3256
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3257
openHTMLDocument:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3258
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3259
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3260
    "Created: / 4.8.1998 / 14:06:10 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3261
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3262
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3263
pullDownMenu
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3264
    "return the top (pullDown) menu"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3265
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3266
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3267
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3268
    |m|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3269
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3270
    m := self class menuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3271
    m := m decodeAsLiteralArray.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3272
    m receiver:self.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3273
    ^ m.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3274
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3275
    "Modified: / 14.8.1998 / 14:09:12 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3276
    "Created: / 14.8.1998 / 14:14:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3277
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3278
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3279
showAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3280
    ToolApplicationModel openAboutSTX
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3281
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3282
    "Created: / 14.8.1998 / 13:18:41 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3283
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3284
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3285
sortChanged
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3286
Transcript show:'fBrowser:'; showCR:sortByWhat value.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3287
    self updateCurrentDirectory
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3288
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3289
    "Created: / 14.8.1998 / 16:17:20 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3290
    "Modified: / 14.8.1998 / 16:44:00 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3291
! !
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3292
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3293
!FileBrowser methodsFor:'misc user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3294
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3295
closeRequest
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3296
    "exit FileBrowser"
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3297
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3298
    (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
  3299
	      yesButton:'close') 
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3300
    ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3301
	"/ self windowGroup closeDownViews.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3302
	super closeRequest
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3303
    ]
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3304
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3305
    "Created: / 3.8.1998 / 19:55:06 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3306
    "Modified: / 4.8.1998 / 18:21:03 / cg"
1786
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3307
!
b209a26b4143 #terminate -> #closeRequest
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
  3308
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3309
destroy
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3310
    "destroy view and boxes"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3311
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3312
    ObjectMemory removeDependent:self.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3313
    self stopUpdateProcess.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3314
    checkBlock := nil.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3315
    super destroy
1145
0464625bbdbb read directory in a subprocess.
Claus Gittinger <cg@exept.de>
parents: 1144
diff changeset
  3316
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  3317
    "Modified: 19.4.1997 / 13:51:48 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3318
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3319
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3320
discardChangesDialog
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3321
    "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
  3322
     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
  3323
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3324
    ^ 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
  3325
	       yesButton:'change'
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3326
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3327
    "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
  3328
!
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3329
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3330
filterPatternChanged
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3331
    fileListView scrollToTop.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3332
    fileListView deselect.
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3333
    self updateCurrentDirectory
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3334
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3335
    "Modified: / 3.10.1998 / 18:23:34 / cg"
346
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3336
!
9ee1f936b7ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
  3337
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3338
update:what with:someArgument from:changedObject
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3339
    realized ifFalse:[^ self].
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3340
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3341
    (what == #aboutToExit) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3342
	"system wants to shut down this
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3343
	 - 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
  3344
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3345
	(subView modified and:[subView contentsWasSaved not]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3346
	    self raiseDeiconified.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3347
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3348
	    (self 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3349
		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
  3350
		yesButton:'save'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3351
		noButton:'don''t save')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3352
	    ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3353
		subView acceptAction notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3354
		    subView accept
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3355
		] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3356
		    subView save
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3357
		]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3358
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3359
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3360
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3361
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3362
    changedObject == tabSpec ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3363
	fileListView invalidate
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3364
    ].
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3365
585
be0241bf7268 use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 564
diff changeset
  3366
    "Modified: 29.5.1996 / 16:13:43 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3367
! !
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3368
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3369
!FileBrowser methodsFor:'pathField user interaction'!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3370
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3371
addDirToJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3372
    "add the current path to javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3373
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3374
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3375
    Java addToClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3376
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3377
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3378
    "Created: 1.8.1997 / 21:25:22 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3379
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3380
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3381
addDirToJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3382
    "add the current path to javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3383
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3384
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3385
    Java addToSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3386
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3387
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3388
    "Created: 2.8.1997 / 14:11:19 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3389
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3390
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3391
changeCurrentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3392
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3393
     otherwise ask for & change to that directory"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3394
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3395
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3396
	self queryForDirectoryToChange
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3397
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3398
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3399
    "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
  3400
    "Modified: 2.10.1997 / 14:09:02 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3401
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3402
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3403
changeDirectoryTo:aDirectoryName
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3404
    "sent from label menu to change back to a previous directory"
132
claus
parents: 126
diff changeset
  3405
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3406
    self discardChangesDialog ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3407
	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
  3408
    ].
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3409
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3410
    "Modified: / 2.10.1997 / 14:09:24 / stefan"
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3411
    "Modified: / 21.7.1998 / 16:38:03 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3412
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3413
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3414
changeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3415
    "if text was modified show a queryBox, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3416
     otherwise change immediately to the default directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3417
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3418
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3419
	 self doChangeToDefaultDirectory
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3420
    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3421
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3422
    "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
  3423
    "Modified: 2.10.1997 / 14:09:33 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3424
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3425
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3426
changeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3427
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3428
     otherwise change immediately to the home directory"
132
claus
parents: 126
diff changeset
  3429
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3430
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3431
	 self doChangeToHomeDirectory
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3432
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3433
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3434
    "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
  3435
    "Modified: 2.10.1997 / 14:09:42 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3436
!
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3437
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3438
changeToParentDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3439
    "if text was modified show a queryBox, 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3440
     otherwise change immediately to the parent directory"
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  3441
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3442
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3443
	 self doChangeToParentDirectory
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3444
    ]
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3445
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3446
    "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
  3447
    "Modified: 2.10.1997 / 14:09:55 / stefan"
98
claus
parents: 93
diff changeset
  3448
!
claus
parents: 93
diff changeset
  3449
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3450
copyPath
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3451
    "copy current path into cut & paste buffer"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3452
873
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3453
    self setTextSelection:currentDirectory pathName
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3454
207dd8d14e57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  3455
    "Modified: 14.12.1996 / 15:37:47 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3456
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3457
1893
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3458
fileAddToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3459
    "add the current path to javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3460
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3461
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3462
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3463
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3464
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3465
    f isNil ifTrue:[
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3466
        ^ self addDirToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3467
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3468
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3469
    Java addToClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3470
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3471
    "Created: / 9.11.1998 / 05:41:34 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3472
    "Modified: / 9.11.1998 / 05:56:00 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3473
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3474
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3475
fileRemoveFromJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3476
    "remove the current path from javas classPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3477
     (only available with ST/J System"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3478
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3479
    |f|
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3480
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3481
    f := self getSelectedFileName.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3482
    f isNil ifTrue:[
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3483
        ^ self removeDirToJavaClassPath
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3484
    ].
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3485
    f := currentDirectory asFilename construct:f.
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3486
    Java removeFromClassPath:(f pathName)
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3487
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3488
    "Created: / 9.11.1998 / 05:42:05 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3489
    "Modified: / 9.11.1998 / 05:56:14 / cg"
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3490
!
1d91f4092152 added addToJava/removeFromJava classPath.
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  3491
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3492
labelMenu
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3493
    "return the popUpMenu for the path label"
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3494
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1227
diff changeset
  3495
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3496
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3497
    ^ self class directoryMenuSpec.
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3498
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3499
    "Modified: / 14.8.1998 / 12:11:16 / cg"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3500
!
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3501
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3502
labelMenu_old
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3503
    "return the popUpMenu for the path label"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3504
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3505
    <resource: #programMenu>
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3506
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3507
    |items menu currentIndex|
1736
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3508
36cab4d1d655 remember last directory in show-diff-text;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3509
    items := #(
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3510
		   ('copy path'                   copyPath                  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3511
		   ('-'                                                     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3512
		   ('up'                          changeToParentDirectory   )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3513
		   ('back'                        changeToPreviousDirectory )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3514
		   ('change to home-directory'    changeToHomeDirectory     )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3515
		   ('change to default-directory' changeToDefaultDirectory  )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3516
		   ('change directory ...'        changeCurrentDirectory    )
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3517
	       ).             
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3518
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3519
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3520
	items := items , #(
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3521
			    ( '-')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3522
			    ( 'add to JavaClassPath'       addDirToJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3523
			    ( 'add to JavaSourcePath'      addDirToJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3524
			    ( 'remove from JavaClassPath'  removeDirFromJavaClassPath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3525
			    ( 'remove from JavaSourcePath' removeDirFromJavaSourcePath)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3526
			  ).
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3527
    ].
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3528
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3529
    DirectoryHistory size > 0 ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3530
	items := items copyWith:#('-').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3531
	items := items ,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3532
		 (DirectoryHistory 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3533
			collect:[:dirName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3534
				    Array 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3535
					with:dirName 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3536
					with:#changeDirectoryTo:
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3537
					with:nil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3538
					with:dirName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3539
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3540
		 ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3541
	currentIndex := items findFirst:[:i | (i at:1) = currentDirectory pathName].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3542
	currentIndex == 0 ifTrue:[currentIndex := nil].
123
claus
parents: 120
diff changeset
  3543
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3544
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3545
    menu := PopUpMenu 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3546
		itemList:items
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3547
		resources:resources.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3548
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3549
    previousDirectory isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3550
	menu disable:#changeToPreviousDirectory.
132
claus
parents: 126
diff changeset
  3551
    ].
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3552
    currentIndex notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3553
	menu disable:currentIndex
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3554
    ].
1400
44af7d61f061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
  3555
    (JavaClassReader notNil and:[JavaClassReader isLoaded]) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3556
	(Java classPath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3557
	    menu disable:#addDirToJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3558
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3559
	    menu disable:#removeDirFromJavaClassPath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3560
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3561
	(Java sourcePath includes:currentDirectory pathName) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3562
	    menu disable:#addDirToJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3563
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3564
	    menu disable:#removeDirFromJavaSourcePath
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3565
	].
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3566
    ].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3567
    ^menu.
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3568
1737
f964e8b41763 better directoryHistory
Claus Gittinger <cg@exept.de>
parents: 1736
diff changeset
  3569
    "Modified: / 21.7.1998 / 16:43:25 / cg"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3570
    "Created: / 14.8.1998 / 12:10:02 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3571
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3572
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3573
pathChanged:newPath
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3574
    "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
  3575
     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
  3576
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3577
    |f name idx|
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3578
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3579
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3580
	f := newPath asFilename.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3581
	(f isDirectory) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3582
	    self changeDirectoryTo:newPath
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3583
	] ifFalse:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3584
	    self changeDirectoryTo:(f directoryName).
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3585
	    self changed:#path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3586
	    name := f baseName.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3587
	    idx := fileList indexOf:name.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3588
	    fileListView selection:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3589
	    self fileSelect:name.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3590
	    self fileGet:true.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3591
	].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3592
    ] ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3593
	self changed:#path.
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3594
    ].
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3595
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3596
    "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
  3597
    "Modified: 7.10.1997 / 14:10:39 / stefan"
1327
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3598
!
c06a0c578e30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1326
diff changeset
  3599
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3600
queryForDirectoryToChange
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3601
    "query for new directory"
123
claus
parents: 120
diff changeset
  3602
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3603
    |queryBox dirName|
98
claus
parents: 93
diff changeset
  3604
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3605
    queryBox := FilenameEnterBox 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3606
		    title:(resources at:'change directory to:') withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3607
		    okText:(resources at:'change')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3608
		    action:[:newName | dirName := newName].
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3609
"/    queryBox initialText:''.
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3610
    queryBox showAtPointer.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3611
    queryBox destroy.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3612
    self doChangeCurrentDirectoryTo:dirName updateHistory:true.
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3613
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  3614
    "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
  3615
    "Modified: 28.4.1997 / 22:30:40 / dq"
1271
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3616
!
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3617
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3618
removeDirFromJavaClassPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3619
    "remove the current path from javas classPath
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3620
     (only available with ST/J System"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3621
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3622
    Java removeFromClassPath:currentDirectory pathName
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3623
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3624
    "Modified: 14.12.1996 / 15:37:47 / cg"
1a9080efbcc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  3625
    "Created: 1.8.1997 / 21:25:36 / cg"
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3626
!
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3627
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3628
removeDirFromJavaSourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3629
    "remove the current path from javas sourcePath
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3630
     (only available with ST/J System"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3631
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3632
    Java removeFromSourcePath:currentDirectory pathName
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3633
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3634
    "Modified: 14.12.1996 / 15:37:47 / cg"
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  3635
    "Created: 2.8.1997 / 14:11:41 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3636
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3637
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3638
!FileBrowser methodsFor:'private'!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3639
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3640
ask:question yesButton:yesButtonText
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3641
    "common method to ask a yes/no question; return true or false"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3642
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3643
    ^ self ask:question yesButton:yesButtonText noButton:'cancel' 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3644
!
93
claus
parents: 85
diff changeset
  3645
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3646
ask:question yesButton:yesButtonText noButton:noButtonText
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3647
    "common method to ask a yes/no question"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3648
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3649
    ^ Dialog 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3650
	confirm:question withCRs
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3651
	yesLabel:(resources at:yesButtonText)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3652
	noLabel:(resources at:noButtonText)
37
50f59bad66b1 *** empty log message ***
claus
parents: 36
diff changeset
  3653
380
ec0cfd2b3200 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
  3654
    "Modified: 21.2.1996 / 01:19:21 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3655
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3656
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  3657
askForCommandFor:fileName thenDo:aBlock
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3658
    "setup and launch a querybox to ask for unix command.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3659
     Then evaluate aBlock passing the command-string as argument."
93
claus
parents: 85
diff changeset
  3660
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3661
    |box osName|
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3662
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3663
    osName := OperatingSystem platformName.
93
claus
parents: 85
diff changeset
  3664
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3665
    box := FilenameEnterBox 
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3666
		title:(resources string:'execute %1 command:' with:osName)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3667
	       okText:(resources string:'execute')
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3668
	       action:aBlock.
79
d78f92a07d5d *** empty log message ***
claus
parents: 75
diff changeset
  3669
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3670
    fileName notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3671
	self initialCommandFor:fileName into:box.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  3672
    ].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  3673
    box directory:currentDirectory.
1142
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  3674
    box showAtPointer.
9066d7d02a3a remember last executed command per suffix; offer this as default.
Claus Gittinger <cg@exept.de>
parents: 1141
diff changeset
  3675
    box destroy.
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3676
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3677
    "Modified: / 7.9.1995 / 10:31:54 / claus"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3678
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3679
    "Modified: / 14.8.1998 / 14:12:52 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3680
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  3681
98
claus
parents: 93
diff changeset
  3682
askIfModified:question yesButton:yesButtonText
claus
parents: 93
diff changeset
  3683
    "tell user, that code has been modified - let her confirm"
claus
parents: 93
diff changeset
  3684
claus
parents: 93
diff changeset
  3685
    (subView modified not or:[subView contentsWasSaved]) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3686
	^ true
98
claus
parents: 93
diff changeset
  3687
    ].
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  3688
    (self ask:(resources string:question) yesButton:yesButtonText) ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3689
	"/ reset modified flag so question is asked only once
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3690
	subView modified:false.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  3691
	^ true
1340
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  3692
    ].
2378e91a0236 stc compilable
Claus Gittinger <cg@exept.de>
parents: 1339
diff changeset
  3693
    ^ false
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3694
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  3695
    "Modified: 2.10.1997 / 14:23:47 / stefan"
98
claus
parents: 93
diff changeset
  3696
!
claus
parents: 93
diff changeset
  3697
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3698
getSelectedFileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3699
    "returns the currently selected file; shows an error if
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3700
     multiple files are selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3701
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3702
    |sel|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3703
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3704
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3705
    (sel size > 1) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3706
        self onlyOneSelection
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3707
    ] ifFalse:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3708
        sel notNil ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3709
            ^ fileList at:sel first ifAbsent:nil
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3710
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3711
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3712
    ^ nil
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3713
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  3714
    "Modified: / 3.10.1998 / 18:21:23 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3715
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3716
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3717
onlyOneSelection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3718
    "show a warning, that only one file must be selected for
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3719
     this operation"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3720
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3721
    self warn:'exactly one file must be selected !!'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3722
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3723
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3724
selectedFilesDo:aBlock
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3725
    "evaluate aBlock on all selected files;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3726
     show a wait cursor while doing this"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3727
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3728
    |sel action|
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
    sel := fileListView selection.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3731
    sel notNil ifTrue:[
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3732
        sel := sel collect:[:aSelectionIndex | 
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3733
            |nm|
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3734
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3735
            nm := fileList at:aSelectionIndex ifAbsent:nil.
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3736
            nm notNil ifTrue:[
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3737
                nm := nm string.
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3738
                (nm endsWith:' ...') ifTrue:[
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3739
                    nm := (nm copyWithoutLast:4) withoutSpaces
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3740
                ].
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3741
            ].
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3742
            nm
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3743
        ].
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3744
        action := [
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3745
            sel do:[:nm |
1903
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3746
                nm notNil ifTrue:[
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3747
                    aBlock value:nm
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3748
                ]
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3749
            ]
1969
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3750
        ].
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3751
        Processor activeProcess == self windowGroup process ifTrue:[
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3752
            self withWaitCursorDo:action
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3753
        ] ifFalse:[
1d2c5c848abd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1968
diff changeset
  3754
            action value
1903
75eee8ee6dd7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  3755
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3756
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3757
1974
f1f93edd83b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1972
diff changeset
  3758
    "Modified: / 16.12.1998 / 17:30:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3759
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3760
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3761
show:something
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3762
    "show something in subview and undef acceptAction"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3763
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3764
    subView contents:something.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3765
    subView acceptAction:nil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3766
    subView modified:false.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3767
    currentFileName := nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3768
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3769
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3770
showAlert:aString with:anErrorString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3771
    "show an alertbox, displaying the last Unix-error"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3772
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3773
    |msg|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3774
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3775
    anErrorString isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3776
	msg := aString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3777
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  3778
	msg := aString , '\\(' , anErrorString , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3779
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3780
    self warn:msg withCRs
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3781
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3782
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3783
withoutHiddenFiles:aCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3784
    "remove hidden files (i.e. those that start with '.') from
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3785
     the list in aCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3786
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3787
    |newCollection|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3788
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3789
    newCollection := aCollection species new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3790
    aCollection do:[:fname |
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3791
	|ignore|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3792
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3793
	ignore := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3794
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3795
	((fname startsWith:'.') and:[fname ~= '..']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3796
	    showingHiddenFiles value "showDotFiles" ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3797
		ignore := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3798
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3799
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3800
	ignore ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3801
	    newCollection add:fname
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  3802
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3803
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3804
    ^ newCollection
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3805
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3806
    "Modified: / 4.8.1998 / 13:46:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3807
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3808
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3809
!FileBrowser methodsFor:'private - actions & command execution'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3810
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3811
binaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3812
    "for some binary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3813
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3814
1330
2d8c64367afc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1329
diff changeset
  3815
    (currentDirectory construct:aFilename) isExecutableProgram ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3816
	(OperatingSystem executeCommand:'cd ', currentDirectory pathName, '; ',aFilename)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3817
	ifTrue:[^true].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3818
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3819
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3820
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3821
    "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
  3822
    "Modified: 18.9.1997 / 17:18:04 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3823
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3824
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3825
doExecuteCommand:commandArg replace:replace
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3826
    "execute a unix command inserting the output of the command.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3827
     If replace is true, all text is replaced by the commands output;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3828
     otherwise, its inserted as selected text at the cursor position."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3829
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3830
    |command stream line lnr myProcess myPriority startLine startCol stopSignal
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  3831
     pauseSignal access stillReplacing pauseHolder lowerFrameView|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3832
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3833
    command := commandArg asString.
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  3834
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3835
    access := Semaphore forMutualExclusion name:'accessLock'.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3836
    stopSignal := Signal new.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3837
    pauseSignal := Signal new.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3838
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3839
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3840
     The following is tricky: 
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3841
     the pauseToggle & killButton will
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3842
     be handled by their own windowGroup process.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3843
     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
  3844
     I myself am reading the commands output.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3845
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3846
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3847
    commandView beInvisible.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  3848
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3849
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3850
     must take kill & pauseButtons out of my group
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3851
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3852
    killButton windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3853
    pauseToggle windowGroup:nil.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3854
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3855
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3856
     bring them to front, and turn hidden-mode off
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3857
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3858
    killButton raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3859
    pauseToggle raise; beVisible.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3860
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3861
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3862
     kill will make me raise the stopSignal when pressed
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3863
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3864
    killButton 
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3865
        action:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3866
            stream notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3867
                access critical:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3868
                    myProcess interruptWith:[stopSignal raiseRequest].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3869
                ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3870
            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3871
        ].
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3872
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3873
    "
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3874
     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
  3875
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3876
    pauseHolder := false asValue.
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3877
    pauseToggle model:pauseHolder.
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3878
    pauseToggle pressAction:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3879
        stream notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3880
            access critical:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3881
                myProcess interruptWith:[pauseSignal raiseRequest].
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
        ]
1335
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3884
    ].
4f8ee6e1d8e1 Use signal instead polling for pauseButton in #doExecuteCommand:replace:.
Stefan Vogel <sv@exept.de>
parents: 1334
diff changeset
  3885
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3886
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3887
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3888
     start kill button under its own windowgroup
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3889
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3890
    killButton openAutonomous.
1298
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3891
    killButton windowGroup process processGroupId:(Processor activeProcess id).
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3892
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3893
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3894
     and add the pauseToggle to its windowGroup
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3895
    "
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3896
    pauseToggle windowGroup:(killButton windowGroup).
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3897
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3898
4ce2a9cd693a allow command-output reading to be paused.
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  3899
    lowerFrameView := subView superView.
1162
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
    "
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3902
     go fork a pipe and read it
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
    self label:(myName , ': executing ' , (command copyTo:(20 min:command size)) , ' ...').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3905
    [
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  3906
      self withWaitCursorDo:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3907
        stopSignal catch:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3908
            pauseSignal handle:[:ex|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3909
                |noPauseSema|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3910
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3911
                "/    
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3912
                "/ allow interaction with
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3913
                "/ the codeView via the other windowGroup
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3914
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3915
                lowerFrameView windowGroup:(killButton windowGroup).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3916
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3917
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3918
                "/ wait for pause to be turned off
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3919
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3920
                noPauseSema := Semaphore new.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3921
                pauseHolder onChangeSend:#signal to:noPauseSema.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3922
                noPauseSema wait.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3923
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3924
                "/    
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3925
                "/ no interaction with the codeView ...
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3926
                "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3927
                lowerFrameView windowGroup:(self windowGroup).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3928
                ex proceed.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3929
            ] do:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3930
                startLine := subView cursorLine.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3931
                startCol := subView cursorCol.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3932
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3933
                "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3934
                 this can be a time consuming operation; therefore lower my priority
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3935
                "
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3936
                myProcess := Processor activeProcess.
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3937
"/                myPriority := myProcess priority.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3938
"/                myProcess priority:(Processor userBackgroundPriority).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3939
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3940
                stream := PipeStream 
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3941
                            readingFrom:command
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3942
                            errorDisposition:#inline
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3943
                            inDirectory:currentDirectory.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3944
                stream notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3945
                    [
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3946
                        |codeView lines noPauseSema enc|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3947
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3948
                        enc := fileEncoding.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3949
                        enc == #iso8859 ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3950
                            enc := nil
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3951
                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3952
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3953
                        stream buffered:true.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3954
                        codeView := subView.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3955
                        codeView unselect.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3956
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3957
                        replace ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3958
                            codeView list:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3959
                            lnr := 1.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3960
                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3961
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3962
                        stillReplacing := replace.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3963
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3964
                        [stream readWait. stream atEnd] whileFalse:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3965
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3966
                             data available; read up to 100 lines
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3967
                             and insert as a single junk. This speeds up
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3968
                             display of long output (less line-scrolling).
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3969
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3970
                            lines := OrderedCollection new:100.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3971
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3972
                            [
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3973
                                line := stream nextLine.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3974
                                line notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3975
                                    enc notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3976
                                        line := line decodeFrom:enc
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3977
                                    ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3978
                                    lines add:line
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3979
                                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3980
                            ] doWhile:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3981
                                stream canReadWithoutBlocking
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3982
                                and:[stream atEnd not
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3983
                                and:[lines size < 100]]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3984
                            ]. 
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3985
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3986
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3987
                             need this critical section; otherwise,
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3988
                             we could get the signal while waiting for
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3989
                             an expose event ...
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3990
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3991
                            access critical:[                        
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3992
                                lines size > 0 ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3993
                                    stillReplacing ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3994
                                        lines do:[:line |
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3995
                                            codeView at:lnr put:line withTabsExpanded.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3996
                                            codeView cursorToBottom; cursorDown:1.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3997
                                            lnr := lnr + 1.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3998
                                            lnr > codeView list size ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  3999
                                                stillReplacing := false
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4000
                                            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4001
                                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4002
                                    ] ifFalse:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4003
                                        codeView insertLines:lines before:codeView cursorLine.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4004
                                        codeView cursorDown:lines size.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4005
                                    ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4006
                                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4007
                            ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4008
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4009
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4010
                             give others running at same prio a chance too
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4011
                             (especially other FileBrowsers doing the same)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4012
                            "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4013
                            Processor yield
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4014
                        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4015
                    ] valueNowOrOnUnwindDo:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4016
                        stream shutDown "close". stream := nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4017
                    ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4018
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4019
                    "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4020
                    "/ the command could have changed the directory
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4021
                    "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4022
                    self updateCurrentDirectoryIfChanged
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4023
                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4024
                replace ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4025
                    subView modified:false.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4026
                ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4027
            ]
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4028
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4029
      ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4030
    ] valueNowOrOnUnwindDo:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4031
        |wg|
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4032
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4033
        self label:myName; iconLabel:myName.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4034
"/        myProcess notNil ifTrue:[myProcess priority:myPriority].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4035
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4036
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4037
         hide the button, and make sure it will stay
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4038
         hidden when we are realized again
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4039
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4040
        killButton beInvisible.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4041
        pauseToggle beInvisible.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4042
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4043
        commandView beVisible.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4044
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4045
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4046
         remove the killButton from its group
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4047
         (otherwise, it will be destroyed when we shut down the group)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4048
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4049
        wg := killButton windowGroup.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4050
        killButton windowGroup:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4051
        pauseToggle windowGroup:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4052
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4053
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4054
         shut down the kill buttons windowgroup
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4055
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4056
        wg notNil ifTrue:[
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4057
            wg process terminate.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4058
        ].
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4059
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4060
         clear its action (actually not needed, but
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4061
         releases reference to thisContext earlier)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4062
        "
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4063
        killButton action:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4064
        pauseToggle pressAction:nil.
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4065
        "/    
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4066
        "/ allow interaction with the codeView
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4067
        "/ (bring it back into my group)
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4068
        "/
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4069
        lowerFrameView windowGroup:(self windowGroup).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4070
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4071
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4072
    currentFileName isNil ifTrue:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4073
        subView modified:false.
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
    subView size > 10000 ifTrue:[
1912
0c8dc1be1553 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1911
diff changeset
  4077
        self warn:'text quite large now - please cut off some lines'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4078
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4079
1358
bda6daa1de70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
  4080
    "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
  4081
    "Modified: / 6.3.1998 / 17:32:03 / stefan"
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4082
    "Modified: / 15.10.1998 / 12:37:52 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4083
!
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
imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4086
    "for some image files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4087
     action ..."
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
    |img|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4090
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4091
    (Image isImageFileSuffix:(aFilename asFilename suffix))
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4092
    ifTrue:[
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  4093
	img := Image fromFile:(currentDirectory construct:aFilename).
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  4094
	img notNil ifTrue:[
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  4095
	    ImageEditor openOnImage:img.
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  4096
"/            img inspect.
1418
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  4097
	    ^ true
c6cce50bf135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  4098
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4099
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4100
    ^ false
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4101
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4102
    "Created: 19.6.1996 / 09:43:50 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4103
    "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
  4104
    "Modified: 18.9.1997 / 16:35:48 / stefan"
1410
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  4105
e2af551da1d1 double click on image files starts image editor
ca
parents: 1400
diff changeset
  4106
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4107
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4108
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4109
initialCommandFor:fileName into:aBox
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4110
    "set a useful initial command for execute box."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4111
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4112
    |cmd select path suffix|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4113
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4114
    "/ XXX should be changed to take stuff from a config file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4115
    "/ XXX or from resources.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4116
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4117
    path := currentDirectory filenameFor:fileName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4118
    (path type == #regular) ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4119
	path isExecutableProgram ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4120
	    aBox initialText:(fileName , ' <arguments>').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4121
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4122
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4123
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4124
	select := true.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4125
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4126
	"some heuristics - my personal preferences ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4127
	 (actually this should come from a configfile)"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4128
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4129
	(fileName endsWith:'akefile') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4130
	    aBox initialText:'make target' selectFrom:6 to:11.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4131
	    ^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4132
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4133
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4134
	suffix := path suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4135
	(suffix = 'C') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4136
	    cmd := 'g++ -c %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4137
	    select := 6.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4138
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4139
	    suffix := suffix asLowercase.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4140
	    (suffix = 'taz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4141
		aBox initialText:'zcat %1 | tar tvf -'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4142
		select := false.
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
	    (suffix = 'tar') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4145
		cmd := 'tar tvf %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4146
		select := 7.
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
	    (suffix = 'zoo') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4149
		cmd := 'zoo -list %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4150
		select := 9.
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
	    (suffix = 'zip') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4153
		cmd := 'unzip -l %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4154
		select := 8.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4155
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4156
	    (suffix = 'jar') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4157
		cmd := 'unzip -l %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4158
		select := 8.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4159
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4160
	    (suffix = 'z') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4161
		(fileName endsWith:'tar.z') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4162
		    cmd := 'zcat %1 | tar tvf -'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4163
		    select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4164
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4165
		    cmd := 'uncompress %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4166
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4167
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4168
	    (suffix = 'gz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4169
		(fileName endsWith:'tar.gz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4170
		    cmd := ('gunzip < %1 | tar tvf -' ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4171
		    select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4172
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4173
		    cmd := 'gunzip %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4174
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4175
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4176
	    (suffix = 'tgz') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4177
		cmd := ('gunzip < %1 | tar tvf -' ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4178
		select := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4179
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4180
	    (suffix = 'html') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4181
		cmd := 'netscape %1'
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
	    (suffix = 'htm') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4184
		cmd := 'netscape %1'
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
	    (suffix = 'uue') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4187
		cmd := 'uudecode %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4188
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4189
	    (suffix = 'c') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4190
		cmd := 'cc -c %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4191
		select := 5.
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
	    (suffix = 'cc') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4194
		cmd := 'g++ -c %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4195
		select := 6.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4196
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4197
	    (suffix = 'xbm') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4198
		cmd := 'bitmap %1'
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
	    (suffix = 'ps') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4201
		cmd := 'ghostview %1'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4202
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4203
	    ((suffix = '1') or:[suffix = 'man']) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4204
		cmd := 'nroff -man %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4205
		select := 10.
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
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4208
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4209
	cmd isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4210
	    DefaultCommandPerSuffix isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4211
		cmd := '<cmd>'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4212
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4213
		cmd := DefaultCommandPerSuffix 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4214
			at:suffix
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4215
			ifAbsent:'<cmd>'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4216
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4217
	    cmd := cmd , ' %1'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4218
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4219
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4220
	cmd := cmd bindWith:fileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4221
	select == false ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4222
	    aBox initialText:cmd
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4223
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4224
	    select isInteger ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4225
		select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4226
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4227
	    aBox initialText:cmd selectFrom:1 to:select
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4228
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4229
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4230
1542
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  4231
    "Modified: / 24.9.1997 / 16:34:52 / stefan"
f16bf880fca8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
  4232
    "Modified: / 9.4.1998 / 17:15:57 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4233
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4234
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4235
nonBinaryFileAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4236
    "for some nonBinary files, if double clicked, we can do some useful
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4237
     action ..."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4238
1493
3a714097f19d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
  4239
    |fullPath|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4240
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4241
    fullPath := currentDirectory filenameFor:aFilename.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4242
    ((fullPath hasSuffix:'htm') or:[fullPath hasSuffix:'html']) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4243
	HTMLDocumentView openOn:fullPath pathName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4244
	^ true
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4245
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4246
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4247
    OperatingSystem isUNIXlike ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4248
	(#('.man' '.1' '.2' '.3') findFirst:[:suff | fullPath hasSuffix:suff]) ~~ 0 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4249
	ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4250
	     HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:fullPath pathName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4251
	    ^ true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4252
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4253
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4254
    ^ self imageAction:aFilename
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4255
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4256
    "Created: 19.6.1996 / 09:36:38 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4257
    "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
  4258
    "Modified: 18.9.1997 / 16:58:40 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4259
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4260
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4261
!FileBrowser methodsFor:'private - directory stuff'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4262
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4263
addToHistory:path
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4264
    |pos idx|
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4265
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4266
    (DirectoryHistory includes:path) ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4267
	DirectoryHistory size >= HistorySize ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4268
	    DirectoryHistory removeLast.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4269
	    DirectoryHistoryWhere removeLast
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4270
	]
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4271
    ] ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4272
	"already been there before; move the entry to
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4273
	 the beginning, so it will fall out later."
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
	idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4276
	DirectoryHistory removeIndex:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4277
	pos := DirectoryHistoryWhere at:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4278
	DirectoryHistoryWhere removeIndex:idx.
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4279
    ].
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4280
    DirectoryHistory addFirst:path.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4281
    DirectoryHistoryWhere addFirst:pos.
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4282
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4283
    "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
  4284
!
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4285
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4286
changeToPreviousDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4287
    "if text was modified show a queryBox, 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4288
     otherwise change immediately to previous directory."
93
claus
parents: 85
diff changeset
  4289
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4290
    previousDirectory isNil ifTrue:[^ self].
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4291
    self discardChangesDialog ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4292
	self doChangeCurrentDirectoryTo:previousDirectory updateHistory:false 
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4293
    ]
1339
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4294
4b712d8c1738 Allow regular filenames to be entered in pathField.
Stefan Vogel <sv@exept.de>
parents: 1336
diff changeset
  4295
    "Modified: 2.10.1997 / 14:13:40 / stefan"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4296
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4297
98
claus
parents: 93
diff changeset
  4298
checkIfDirectoryHasChanged
claus
parents: 93
diff changeset
  4299
    "every checkDelta secs, check if directoy has changed and update the list if so.
claus
parents: 93
diff changeset
  4300
     Also, we check if the file shown has been touched in the meanwhile (for example,
claus
parents: 93
diff changeset
  4301
     from another browser) and say 'outdated' in the label if so. 
claus
parents: 93
diff changeset
  4302
     This avoids confusion if the same file is being edited by two browsers. (or other editors).
claus
parents: 93
diff changeset
  4303
     If the text shown in the codeView has been edited, 'modified' is shown.
claus
parents: 93
diff changeset
  4304
    "
claus
parents: 93
diff changeset
  4305
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4306
    |oldSelection nOld newState msg newLabel t|
98
claus
parents: 93
diff changeset
  4307
claus
parents: 93
diff changeset
  4308
    shown ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4309
	currentDirectory notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4310
	    lockUpdate ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4311
		Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4312
		Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4313
		^ self
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4314
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4315
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4316
	    subView modified ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4317
		newState := ' (modified)'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4318
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4319
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4320
	    (currentDirectory isReadable) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4321
		Processor removeTimedBlock:checkBlock.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4322
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4323
		t := currentDirectory modificationTime.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4324
		(t notNil and:[t > timeOfLastCheck]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4325
		    nOld := fileListView numberOfSelections.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4326
		    oldSelection := fileListView selectionValue.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4327
		    self updateCurrentDirectory.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4328
		    nOld ~~ 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4329
			nOld > 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4330
			    oldSelection do:[:element  |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4331
				fileListView addElementToSelection:element
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4332
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4333
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4334
			    fileListView selectElementWithoutScroll:oldSelection
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4335
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4336
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4337
		] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4338
		    Processor addTimedBlock:checkBlock afterSeconds:checkDelta
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4339
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4340
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4341
		currentFileName notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4342
		    |f|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4343
		    f := currentDirectory construct:currentFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4344
		    f exists ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4345
			newState := ' (removed)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4346
		    ] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4347
			f modificationTime > timeOfFileRead ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4348
			    newState := ' (outdated)'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4349
			    subView modified ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4350
				newState := ' (modified & outdated)'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4351
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4352
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4353
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4354
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4355
	    ] ifFalse:[         
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4356
		"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4357
		 if the directory has been deleted, or is not readable ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4358
		"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4359
		(currentDirectory exists) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4360
		    msg := 'FileBrowser:\\directory %1 is gone ?!!?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4361
		] ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4362
		    msg := 'FileBrowser:\\directory %1 is no longer readable ?!!?'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4363
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4364
		self warn:(resources string:msg with:currentDirectory pathName) withCRs.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4365
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4366
		fileListView contents:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4367
		newLabel := myName , ': directory is gone !!'.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4368
		"/ Processor addTimedBlock:checkBlock afterSeconds:checkDelta
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4369
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4370
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4371
	    newState notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4372
		newLabel := myName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4373
		currentFileName notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4374
		    newLabel := newLabel , ': ' , currentFileName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4375
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4376
		newLabel := newLabel , newState.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4377
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4378
	    newLabel notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4379
		self label:newLabel.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4380
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4381
	]
98
claus
parents: 93
diff changeset
  4382
    ]
1168
b157f3712548 care for nil returns from userName/groupName * time queries
Claus Gittinger <cg@exept.de>
parents: 1166
diff changeset
  4383
1380
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4384
    "Modified: / 28.4.1997 / 22:31:02 / dq"
547d31bfa12c warning string fixed when directory vanishes
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
  4385
    "Modified: / 16.9.1997 / 15:17:15 / stefan"
1481
71a3292de680 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4386
    "Modified: / 18.2.1998 / 17:57:49 / cg"
98
claus
parents: 93
diff changeset
  4387
!
claus
parents: 93
diff changeset
  4388
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4389
doChangeCurrentDirectoryTo:fileName updateHistory:updateHistory 
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4390
    "verify argument is name of a readable & executable directory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4391
     and if so, go there"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4392
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4393
    |msg path idx f|
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4394
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4395
    self label:myName; iconLabel:myName.
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4396
    fileName notNil ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4397
	f := (currentDirectory filenameFor:fileName) asAbsoluteFilename.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4398
	(f isDirectory) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4399
	    (f isReadable) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4400
		(f isExecutable) ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4401
		    path := currentDirectory pathName.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4402
		    previousDirectory := path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4403
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4404
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4405
		     remember where we are positioned in the fileList
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4406
		     (in case we want to return)
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4407
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4408
		    idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4409
		    idx ~~ 0 ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4410
			DirectoryHistoryWhere at:idx put:fileListView firstLineShown
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4411
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4412
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4413
		    updateHistory ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4414
			self addToHistory:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4415
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4416
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4417
		    self setCurrentDirectory:(f pathName).
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4418
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4419
		    "/ fetch the new path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4420
		    path := currentDirectory pathName.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4421
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4422
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4423
		     if we have already been there, look for the
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4424
		     position offset, and scroll the fileList
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4425
		    "
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4426
		    idx := DirectoryHistory indexOf:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4427
		    idx ~~ 0 ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4428
			|pos|
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4429
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4430
			pos := DirectoryHistoryWhere at:idx.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4431
			pos notNil ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4432
			    fileListView scrollToLine:pos.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4433
			]
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4434
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4435
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4436
		    updateHistory ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4437
			self addToHistory:path.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4438
		    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4439
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4440
		    ^ self
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4441
		].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4442
		msg := 'cannot change directory to ''%1'' !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4443
	    ] ifFalse:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4444
		msg := 'cannot read directory ''%1'' !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4445
	    ]
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4446
	] ifFalse:[
1859
56d0cf48acd2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1857
diff changeset
  4447
	    OperatingSystem isVMSlike ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4448
		"/ cannot tell if it exists or is simply invisible ...
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4449
		msg := '''%1'' is not a directory or unreadable !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4450
	    ] ifFalse:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4451
		msg := '''%1'' is not a directory !!'
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4452
	    ]
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4453
	].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  4454
	self showAlert:(resources string:msg with:fileName) with:nil
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4455
    ]
1166
0029f77ccea7 when updating the directoryList,
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
  4456
1371
a80db8d0e311 remember directory in history when entering (not when leaving)
Claus Gittinger <cg@exept.de>
parents: 1358
diff changeset
  4457
    "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
  4458
    "Modified: / 8.11.1997 / 17:17:17 / cg"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4459
!
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4460
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4461
doChangeToDefaultDirectory
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4462
    "go to parent directory"
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4463
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4464
    self doChangeCurrentDirectoryTo:(Filename currentDirectory pathName) updateHistory:true
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4465
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4466
    "Created: 21.9.1997 / 23:45:59 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4467
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4468
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4469
doChangeToHomeDirectory
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4470
    "go to home directory"
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4471
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4472
    self doChangeCurrentDirectoryTo:(OperatingSystem getHomeDirectory) updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4473
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4474
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4475
doChangeToParentDirectory
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4476
    "go to parent directory"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  4477
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4478
    self doChangeCurrentDirectoryTo:'..' updateHistory:true
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4479
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4480
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4481
doCreateDirectory:newName
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4482
    |f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4483
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4484
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4485
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4486
	self warn:'%1 already exists.' with:newName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4487
	^ self
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4488
    ].
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4489
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4490
    f makeDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4491
	self updateCurrentDirectoryIfChanged
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4492
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4493
	self showAlert:(resources string:'cannot create directory ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4494
		  with:(OperatingSystem lastErrorString)
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4495
    ]
1157
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  4496
667a57034e40 only update if the directory did change (after execute command)
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  4497
    "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
  4498
    "Modified: 18.9.1997 / 17:21:25 / stefan"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4499
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4500
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4501
setCurrentDirectory:aPathName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4502
    "setup for another directory"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4503
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4504
    |newDirectory|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4505
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4506
    aPathName isEmpty ifTrue:[^ self].
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4507
    newDirectory := currentDirectory filenameFor:aPathName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4508
    newDirectory isDirectory ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4509
	self currentDirectory:newDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4510
	currentFileName notNil ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4511
	    fileListView contents:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4512
	    currentFileName := nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4513
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4514
	    fileListView setSelection:nil.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4515
	    fileListView scrollToTop.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4516
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4517
	self updateCurrentDirectory.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4518
	self showInfo.
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4519
    ]
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  4520
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4521
    "Modified: 21.9.1995 / 11:22:45 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4522
    "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
  4523
    "Modified: 18.9.1997 / 17:08:07 / stefan"
912
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  4524
!
dae70963b64c define language specific commentStrings
Claus Gittinger <cg@exept.de>
parents: 874
diff changeset
  4525
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4526
updateCurrentDirectoryIfChanged
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4527
    |t|
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4528
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4529
    OperatingSystem isMSDOSlike ifTrue:[
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4530
        "/ workaround: DOS has no diretory modifiation time ...
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4531
        self updateCurrentDirectory.
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4532
        ^ self
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4533
    ].
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4534
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4535
    ((t := currentDirectory modificationTime) isNil
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4536
    or:[t > timeOfLastCheck]) ifTrue:[
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4537
        self updateCurrentDirectory
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4538
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4539
1837
83acb9c13eff win32 changes
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  4540
    "Modified: / 16.9.1997 / 15:35:52 / stefan"
1975
ca18aa084e4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  4541
    "Modified: / 16.12.1998 / 22:55:44 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4542
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4543
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4544
!FileBrowser methodsFor:'private - encoding'!
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  4545
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4546
guessEncodingFrom:aBuffer
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4547
    "look for a string
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4548
	encoding #name
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4549
     or:
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4550
	encoding: name
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4551
     within the given buffer 
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4552
     (which is usually the first few bytes of a textFile).
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4553
     If thats not found, use heuristics (in CharacterArray) to guess."
988
40eba68d33f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  4554
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4555
    |n "{Class: SmallInteger }"
1209
f8165b43f949 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1207
diff changeset
  4556
     binary idx s w enc|
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4557
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4558
    binary := false.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4559
    n := aBuffer size.
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4560
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4561
    (idx := aBuffer findString:'charset=') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4562
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4563
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4564
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4565
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4566
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4567
	    (idx := w indexOf:$") ~~ 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4568
		w := w copyTo:idx-1
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4569
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4570
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4571
	].
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4572
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4573
    (idx := aBuffer findString:'encoding') ~~ 0 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4574
	s := ReadStream on:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4575
	s position:idx + 8.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4576
	s skipSeparators.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4577
	s peek == $: ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4578
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4579
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4580
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4581
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4582
	s peek == $# ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4583
	    s next.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4584
	    s skipSeparators. 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4585
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4586
	w := s upToSeparator.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4587
	w notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4588
	    ^ w asSymbol
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4589
	].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4590
    ].
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4591
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4592
    1 to:n do:[:i |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4593
	(aBuffer at:i) isPrintable ifFalse:[binary := true].
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4594
    ].
807
d14ccf8ab4a2 improved check for encoding;
Claus Gittinger <cg@exept.de>
parents: 763
diff changeset
  4595
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4596
    binary ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4597
	"/ look for JIS7 / EUC encoding
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4598
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4599
	enc := CharacterArray guessEncodingFrom:aBuffer.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4600
	enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4601
	    ^ enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4602
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4603
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4604
	"/ if the encoding has been set to any non iso setting,
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4605
	"/ assume its what we defined ...
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4606
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4607
	(('iso*' match:fileEncoding) or:['ascii*' match:fileEncoding]) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4608
	    ^ #binary
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4609
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4610
	^ fileEncoding ? #binary
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4611
    ].
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4612
    ^ #ascii
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4613
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4614
    "Created: 26.2.1996 / 17:43:08 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4615
    "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
  4616
!
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4617
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4618
preferredFontEncodingFor:fileEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4619
    "given a file encoding, return corresponding preferred fontEncoding
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4620
     match pattern"
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4621
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4622
    |fe|
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4623
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4624
    fe := MIMETypes fontForCharset:fileEncoding.
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4625
    fe notNil ifTrue:[^ fe].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4626
    ^ 'iso8859*'
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4627
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4628
    "Created: 28.6.1997 / 20:47:35 / cg"
1223
2c7afbcefed9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  4629
    "Modified: 1.7.1997 / 00:04:56 / cg"
395
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4630
!
ae713196f3e6 added guess on encoding
Claus Gittinger <cg@exept.de>
parents: 389
diff changeset
  4631
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4632
validateFontEncodingFor:newEncoding ask:ask
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4633
    "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
  4634
     which is able to display text encoded as specified by newEncoding"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4635
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  4636
    |fontsEncoding msg filter f defaultFont pref|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4637
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4638
    fontsEncoding := subView font encoding.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4639
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4640
    pref := self preferredFontEncodingFor:newEncoding.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4641
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4642
    (pref match:fontsEncoding) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4643
	^ self
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4644
    ].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4645
    "/ stupid ...
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4646
    pref = 'ascii*' ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4647
	(fontsEncoding match:'iso8859*') ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4648
	    ^ self
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4649
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4650
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4651
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4652
    filter := [:f | |coding|
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4653
		    (coding := f encoding) notNil 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4654
		    and:[pref match:coding]].
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4655
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4656
    defaultFont := TextView defaultFont onDevice:device.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4657
    (pref match:(defaultFont encoding)) ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4658
	defaultFont := nil.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4659
    ].
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4660
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4661
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4662
	(pref = 'ascii*'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4663
	or:[pref = 'iso8859*']) ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4664
	    defaultFont := FontDescription family:'courier' face:'medium' style:'roman' size:12
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4665
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4666
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4667
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4668
    defaultFont isNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4669
	defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4670
			    listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4671
				detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4672
				ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4673
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4674
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4675
	    "/ flush list, and refetch font list
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4676
	    "/ (in case someone just changed the font path ...)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4677
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4678
	    device flushListOfAvailableFonts.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4679
	    defaultFont := device 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4680
				listOfAvailableFonts 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4681
				    detect:[:f | filter value:f]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4682
				    ifNone:nil.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4683
	].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4684
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4685
	defaultFont isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4686
	    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
  4687
	    ^ self.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4688
	]
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4689
    ].
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4690
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4691
    msg := 'switch to a %1 encoded font ?'.
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4692
    (ask not or:[self confirm:(resources string:msg with:pref) withCRs])
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4693
    ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4694
	self withWaitCursorDo:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4695
	    f := FontPanel 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4696
		fontFromUserInitial:defaultFont
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4697
			      title:(resources string:'font selection')
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4698
			     filter:filter.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4699
	    f notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4700
		subView font:f
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4701
	    ]
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  4702
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4703
    ]
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4704
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4705
    "Created: 26.10.1996 / 12:06:54 / cg"
1221
ac1737be683b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
  4706
    "Modified: 30.6.1997 / 17:46:46 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4707
! !
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4708
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4709
!FileBrowser methodsFor:'private - file stuff'!
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
doCreateFile:newName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4712
    "create an empty file"
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
    |aStream f|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4715
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4716
    f := currentDirectory filenameFor:newName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4717
    f exists ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4718
	(self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4719
	    ask:(resources string:'%1 already exists\\truncate ?' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4720
	    yesButton:'truncate'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4721
	) ifFalse:[^ self].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4722
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4723
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4724
    FileStream openErrorSignal handle:[:ex|
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4725
	^ self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4726
		    with:(FileStream lastErrorString)
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4727
    ] do:[    
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4728
	aStream := f newReadWriteStream.
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4729
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4730
    aStream notNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4731
	aStream close.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4732
	self updateCurrentDirectoryIfChanged
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4733
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4734
	self showAlert:(resources string:'cannot create file ''%1'' !!' with:newName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  4735
		  with:(FileStream lastErrorString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4736
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4737
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4738
    "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
  4739
    "Modified: 18.9.1997 / 17:21:45 / stefan"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4740
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  4741
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4742
doFileGet:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4743
    "get selected file - show contents in subView.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4744
     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
  4745
     When invoked via the menu (viaDoubleClick argument is false),
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4746
     the automatic file action is not performed - instead, the file is always
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4747
     shown in the codeView (if possible).
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4748
     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
  4749
     action) to be edited."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4750
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4751
    |fileName iconLbl winLbl f|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4752
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4753
    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
  4754
        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
  4755
        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
  4756
            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
  4757
            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
  4758
                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
  4759
                winLbl := myName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4760
                iconLbl := myName
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4761
            ] ifFalse:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4762
                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
  4763
                    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
  4764
                    ^ self
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4765
                ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4766
                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
  4767
                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
  4768
                currentFileName := fileName.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4769
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4770
                self fileTypeSpecificActions.
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4771
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4772
                subView acceptAction:[:theCode |
1956
dae4a93b835b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
  4773
                    (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
  4774
                    or:[
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4775
                        (self 
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4776
                            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
  4777
                            yesButton:'save'
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4778
                            noButton:'don''t save')]) ifTrue:[
1956
dae4a93b835b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
  4779
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4780
                        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
  4781
                            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
  4782
                            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
  4783
                            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
  4784
                        ]
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4785
                    ]
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4786
                ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4787
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4788
                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
  4789
                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
  4790
                    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
  4791
                ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4792
                iconLbl := fileName
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4793
            ].
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4794
            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
  4795
            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
  4796
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4797
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4798
1955
e10babdbf077 before accepting, see if the file is outdated and warn if so.
Claus Gittinger <cg@exept.de>
parents: 1950
diff changeset
  4799
    "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
  4800
    "Modified: / 18.9.1997 / 17:35:31 / stefan"
1956
dae4a93b835b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
  4801
    "Modified: / 7.11.1998 / 16:27:39 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4802
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4803
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4804
doFindFileNamed:namePattern ignoreCase:ignCaseInName containingString:contentsString ignoreCaseInContents:ignCaseInString sameContentsAsFile:filenameToCompareContentsOrNil sameContentsAs:bytesToCompareContentsOrNil in:aDirectory
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4805
    |dir subDirs nameMatches contentsMatches lines contentsToCompare|
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4806
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4807
    bytesToCompareContentsOrNil notNil ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4808
        contentsToCompare := bytesToCompareContentsOrNil
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4809
    ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4810
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4811
    subDirs := OrderedCollection new.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4812
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4813
    dir := aDirectory asFilename.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4814
    self label:myName , '- searching ' , dir name.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4815
    (dir directoryContents ? #()) sort do:[:fn |
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4816
        |f|
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4817
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4818
        f := dir construct:fn.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4819
        f isDirectory ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4820
            f isSymbolicLink ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4821
                subDirs add:f
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4822
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4823
        ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4824
            (nameMatches := namePattern isNil) ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4825
                ignCaseInName ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4826
                    nameMatches := namePattern match:(fn asLowercase)
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4827
                ] ifFalse:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4828
                    nameMatches := namePattern match:fn
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4829
                ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4830
            ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4831
            nameMatches ifTrue:[
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4832
                filenameToCompareContentsOrNil notNil ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4833
                    "/ contents compare ...
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4834
                    contentsMatches := false.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4835
                    f pathName ~= filenameToCompareContentsOrNil pathName ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4836
                        f fileSize == filenameToCompareContentsOrNil fileSize ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4837
                            contentsToCompare isNil ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4838
                                filenameToCompareContentsOrNil fileSize < (512*1024) ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4839
                                    contentsToCompare := filenameToCompareContentsOrNil binaryContentsOfEntireFile
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4840
                                ]
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4841
                            ].
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4842
                            contentsToCompare isNil ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4843
                                "/ too large - compare block-wise ...
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4844
                                contentsMatches := (filenameToCompareContentsOrNil sameContentsAs:f).
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4845
                            ] ifFalse:[
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4846
                                contentsMatches := contentsToCompare = (f binaryContentsOfEntireFile).
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4847
                            ]
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4848
                        ].
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4849
                    ] ifFalse:[
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4850
                        f isSymbolicLink ifTrue:[
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4851
                            subView insertLine:(f name , ' is a symbolic link to ' , f pathName)  before:subView cursorLine.
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4852
                            subView cursorDown.
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4853
                        ]
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4854
                    ]
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4855
                ] ifFalse:[
1966
a2ad4a6bf398 care for symbolic links when searching contents.
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  4856
                    "/ string search ...
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4857
                    (contentsMatches := contentsString isNil) ifFalse:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4858
                        (f exists and:[f isReadable]) ifFalse:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4859
                            subView insertLine:('*** ' , f pathName , ' skipped - unreadable or bad symbolic link ***') before:subView cursorLine.
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4860
                            subView cursorDown.
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4861
                        ] ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4862
                            f fileSize > (4024*1024) ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4863
                                subView insertLine:('*** ' , f pathName , ' skipped - too large ***') before:subView cursorLine.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4864
                                subView cursorDown.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4865
                            ] ifFalse:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4866
                                Stream lineTooLongErrorSignal handle:[:ex |
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4867
                                    |cont|
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4868
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4869
                                    "/ this typically happens, when a binary file is read linewise ...
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4870
                                    cont := f readStream binary contentsOfEntireFile.
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4871
                                    ignCaseInString ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4872
                                        contentsMatches := cont asLowercase includesString:contentsString
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4873
                                    ] ifFalse:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4874
                                        contentsMatches := cont includesString:contentsString
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4875
                                    ].
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4876
                                ] do:[    
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4877
                                    lines := f contents ? #().
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4878
                                    ignCaseInString ifTrue:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4879
                                        contentsMatches := (lines findFirst:[:l | l asLowercase includesString:contentsString]) ~~ 0
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4880
                                    ] ifFalse:[
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4881
                                        contentsMatches := (lines findFirst:[:l | l includesString:contentsString]) ~~ 0
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4882
                                    ].
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4883
                                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4884
                            ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4885
                        ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4886
                    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4887
                ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4888
                contentsMatches ifTrue:[
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4889
                    subView insertLine:f pathName before:subView cursorLine.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4890
                    subView cursorDown.
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4891
                ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4892
            ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4893
        ]
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4894
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4895
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4896
    subDirs do:[:dir |
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4897
        self
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4898
            doFindFileNamed:namePattern 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4899
            ignoreCase:ignCaseInName 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4900
            containingString:contentsString 
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4901
            ignoreCaseInContents:ignCaseInString 
1965
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4902
            sameContentsAsFile:filenameToCompareContentsOrNil 
2533c3e08243 added contents search.
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
  4903
            sameContentsAs:contentsToCompare
1933
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4904
            in:dir
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4905
    ].
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4906
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4907
    "Created: / 15.10.1998 / 11:37:15 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4908
    "Modified: / 15.10.1998 / 12:50:48 / cg"
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4909
!
ee09e254fe18 added file finder
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4910
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  4911
doRemove:filesToRemove
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4912
    "remove the selected file(s) - no questions asked"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4913
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4914
    |msg idx needUpdate toRemove updateRunning yesToAll|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4915
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4916
    updateRunning := listUpdateProcess notNil.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4917
    self stopUpdateProcess.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4918
    toRemove := OrderedCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4919
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4920
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4921
    "/ did the directory change in the meanwhile ?
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4922
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  4923
    needUpdate := (currentDirectory modificationTime > timeOfLastCheck).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4924
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4925
    yesToAll := false.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4926
    lockUpdate := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4927
    [
1961
f81295571da7 care for updating listView while removing (get selection before)
Claus Gittinger <cg@exept.de>
parents: 1956
diff changeset
  4928
        filesToRemove do:[:fileName |
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4929
            |f|
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4930
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4931
            f := currentDirectory construct:fileName.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4932
            OperatingSystem accessDeniedErrorSignal handle:[:ex|
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4933
                "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
  4934
                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
  4935
                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
  4936
            ] do:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4937
                |answer contents|
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4938
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4939
                (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
  4940
                    contents := f directoryContents.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4941
                    contents isEmpty ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4942
                        f remove
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4943
                    ] ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4944
                        yesToAll ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4945
                            answer := Dialog
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4946
                                        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
  4947
                                        labels:#('cancel' 'remove all' 'remove')
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4948
                                        values:#(false #removeAll true) 
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4949
                                        default:3.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4950
                            answer == false ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4951
                                ^ self
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4952
                            ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4953
                            answer == #removeAll ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4954
                                yesToAll := true
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4955
                            ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4956
                        ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4957
                        f recursiveRemove
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4958
                    ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4959
                ] ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4960
                    f remove.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4961
                ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4962
"
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4963
                self show:nil
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4964
"
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4965
                idx := fileList indexOf:fileName.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4966
                idx ~~ 0 ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4967
                    toRemove add:idx.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4968
                ]
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4969
            ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4970
        ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4971
    ] valueNowOrOnUnwindDo:[
1945
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4972
        lockUpdate := false.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4973
        fileListView setSelection:nil.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4974
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4975
        "/
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4976
        "/ 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
  4977
        "/
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4978
        toRemove sort.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4979
        toRemove reverseDo:[:idx |
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4980
            fileList removeIndex:idx.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4981
            fileListView removeIndex:idx.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4982
        ].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4983
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4984
        updateRunning ifTrue:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4985
            self updateCurrentDirectory
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4986
        ] ifFalse:[
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4987
            "
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4988
             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
  4989
            "
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4990
            needUpdate ifFalse:[timeOfLastCheck := AbsoluteTime now].
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4991
            Processor removeTimedBlock:checkBlock.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4992
            Processor addTimedBlock:checkBlock afterSeconds:checkDelta.
8acc1753a8ed added 'yes-to-all' in multi-remove confirmation dialog.
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4993
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4994
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4995
1374
b3a1e95a6220 Do not ask for nonempty directory if remove target is a symlink
Stefan Vogel <sv@exept.de>
parents: 1371
diff changeset
  4996
    "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
  4997
    "Modified: / 21.10.1998 / 17:02:11 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4998
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  4999
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5000
doRename:oldName to:newName
1331
73e712c85588 Handle errors when renaming files.
Stefan Vogel <sv@exept.de>
parents: 1330
diff changeset
  5001
    "rename a file (or directory)"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5002
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5003
    |old new|
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5004
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5005
    (oldName notNil and:[newName notNil]) ifTrue:[
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5006
        (oldName isBlank or:[newName isBlank]) ifFalse:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5007
            old := currentDirectory filenameFor:oldName.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5008
            new := currentDirectory filenameFor:newName.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5009
            OperatingSystem errorSignal handle:[:ex|
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5010
                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
  5011
                                          with:oldName with:newName)
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5012
                          with:(OperatingSystem lastErrorString)
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5013
            ] do:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5014
                new exists ifTrue:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5015
                    (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
  5016
                    ifFalse:[
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5017
                        ^ self
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5018
                    ]
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5019
                ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5020
                old renameTo:new.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5021
            ].
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5022
            self updateCurrentDirectoryIfChanged.
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5023
        ]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5024
    ]
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5025
1911
6d1b77eda98f check for existing target when renaming files;
Claus Gittinger <cg@exept.de>
parents: 1903
diff changeset
  5026
    "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
  5027
    "Modified: / 3.10.1998 / 18:19:27 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5028
! !
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
!FileBrowser methodsFor:'private - file type & info'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5031
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5032
fileCommentStrings
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5033
    "return a useful comment definition; based upon the fileName for now"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5034
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5035
    "/ for now,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5036
    "/ define comment strings, by heuristics;
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5037
    "/ (should look for some mode= or similar string
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5038
    "/  found in the file itself - like emacs does it)
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5039
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5040
    (currentFileName = 'Make.proto'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5041
    or:[currentFileName = 'Makefile'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5042
    or:[currentFileName = 'makefile']]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5043
	^ #('#' (nil nil)).
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
    ((currentFileName endsWith:'.c')
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5046
    or:[(currentFileName endsWith:'.C')]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5047
	^ #(nil ('/*' '*/')).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5048
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5049
    ((currentFileName endsWith:'.cc')
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5050
    or:[(currentFileName endsWith:'.CC')]) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5051
	^ #('//' ('/*' '*/')).
1162
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
    (currentFileName endsWith:'.java') ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5054
	^ #('//' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5055
    ].
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
    "/ smalltalk comments
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5058
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5059
    ^ #('"/' ('"' '"')).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5060
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5061
    "Created: 7.1.1997 / 20:30:00 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5062
    "Modified: 23.4.1997 / 13:11:49 / cg"
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
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5065
fileTypeSpecificActions
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5066
    "any special fileTypeSpecific actions are done here,
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5067
     when a new file is selected"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5068
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5069
    |commentStrings|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5070
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5071
    commentStrings := self fileCommentStrings.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5072
    commentStrings notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5073
	subView
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5074
	    commentStrings:#('#' (nil nil)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5075
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5076
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5077
    "Modified: 7.1.1997 / 20:30:54 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5078
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5079
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5080
getFileInfoString:longInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5081
    "get stat info on selected file - return a string which can be
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5082
     shown in a box"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5083
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5084
    |fileName f fullPath text info fileOutput type modeBits modeString s ts|
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
    fileName := self getSelectedFileName.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5087
    fileName isNil ifTrue:[^ nil].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5088
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5089
    f := currentDirectory construct:fileName.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5090
    info := f info.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5091
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5092
    info isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5093
	self showAlert:(resources string:'cannot get info of ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5094
		  with:(OperatingSystem lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5095
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5096
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5097
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5098
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5099
    f isSymbolicLink ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5100
	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
  5101
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5102
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5103
    type := info type.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5104
    (longInfo and:[type == #regular]) ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5105
	fullPath := currentDirectory pathName asFilename constructString:fileName.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5106
	fileOutput := fullPath asFilename fileType.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5107
    ].
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
    s := (resources at:'type:   ').
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5110
    fileOutput isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5111
	s := s ,  type asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5112
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5113
	s := s , 'regular (' , fileOutput , ')'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5114
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5115
    text add:s.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5116
    text add:(resources string:'size:   %1' with:(info size) printString).
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5117
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5118
    modeBits := info mode.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5119
    modeString := self getModeString:modeBits.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5120
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5121
	text add:(resources string:'access: %1 (%2)'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5122
			      with:modeString 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5123
			      with:(modeBits printStringRadix:8))
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5124
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5125
	text add:(resources string:'access: %1' with:modeString)
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5126
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5127
    text add:(resources string:'owner:  %1'
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5128
			  with:(OperatingSystem getUserNameFromID:(info uid))).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5129
    longInfo ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5130
	text add:(resources string:'group:  %1'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5131
			      with:(OperatingSystem getGroupNameFromID:(info gid))).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5132
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5133
	ts := info accessed.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5134
	text add:(resources string:'last access:       %1 %2' 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5135
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5136
			      with:(ts asDate printString)).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5137
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5138
	ts := info modified.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5139
	text add:(resources string:'last modification: %1 %2'
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5140
			      with:(ts asTime printString)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5141
			      with:(ts asDate printString)).
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5142
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5143
    ^ text asString
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
    "Modified: 8.9.1995 / 11:59:28 / claus"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5146
    "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
  5147
    "Modified: 18.9.1997 / 16:34:31 / stefan"
1162
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
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5150
getInfoFile
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5151
    "get filename of a description-file (.dir.info, README etc.);
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5152
     This file is automatically shown when a directory is enterred.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5153
     You can add more names below if you like."
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
    #( 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5156
       '.dir.info'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5157
       'README'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5158
       'ReadMe'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5159
       'Readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5160
       'readme'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5161
       'read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5162
       'Read.me'
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5163
       'READ.ME'
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5164
       'README.TXT'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5165
       'readme.txt'
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5166
       'Readme.txt'
1307
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  5167
       'Info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  5168
       'info.txt'
67a0a7849514 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
  5169
       'INFO.TXT'
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5170
    ) do:[:f | 
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5171
	|n|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5172
	n := currentDirectory construct:f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5173
	(n isReadable and:[n isDirectory not]) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5174
	    ^ f.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5175
	]
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5176
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5177
    ^ nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5178
1272
af9ac7e0c25c added java-classPath stuff
Claus Gittinger <cg@exept.de>
parents: 1271
diff changeset
  5179
    "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
  5180
    "Modified: 16.9.1997 / 15:26:53 / stefan"
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
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5183
getModeString:modeBits
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5184
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5185
     This is wrong here - should be moved into OperatingSystem."
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
    ^ self getModeString:modeBits 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5188
		    with:#( 'owner:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5189
			    ' group:' $r $w $x 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5190
			    ' others:' $r $w $x )
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5191
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5192
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5193
getModeString:modeBits with:texts
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5194
    "convert file-mode bits into a more user-friendly string.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5195
     This is wrong here - should be moved into OperatingSystem."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5196
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5197
    |bits modeString|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5198
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5199
    bits := modeBits bitAnd:8r777.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5200
    modeString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5201
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5202
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5203
    with: texts do:[:bitMask :access |
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5204
	|ch|
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5205
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5206
	bitMask isNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5207
	    modeString := modeString , (resources string:access)
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5208
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5209
	    (bits bitAnd:bitMask) == 0 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5210
		ch := $-
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5211
	    ] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5212
		ch := access
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5213
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5214
	    modeString := modeString copyWith:ch 
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5215
	]
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5216
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5217
    ^ modeString
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5218
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5219
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5220
showInfo
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5221
    "show directory info when dir has changed"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5222
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5223
    |info txt|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5224
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5225
    info := self getInfoFile.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5226
    info notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5227
	txt := self readFile:info
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5228
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5229
    self show:txt.
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
sizePrintString:size
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5233
    "helper for update-directory to return a string with a files size.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5234
     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
  5235
     If you dont like this, just uncomment the first statement below."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5236
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5237
    |unitString n|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5238
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5239
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5240
    ^ size printString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5241
"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5242
    unitString := ''.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5243
    size < (500 * 1024) ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5244
	size < 1024 ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5245
	    n := size
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5246
	] ifFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5247
	    n := (size * 10 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5248
	    unitString := ' Kb'
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5249
	]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5250
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5251
	n := (size * 10 // 1024 // 1024 / 10.0).
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5252
	unitString := ' Mb'
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5253
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5254
    ^ (n printStringLeftPaddedTo:5) , unitString.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5255
! !
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
!FileBrowser methodsFor:'private - file-I/O'!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5258
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5259
readFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5260
    "read in the file, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5261
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5262
    ^ self readFile:fileName lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5263
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5264
    "Modified: 22.2.1996 / 14:57:08 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5265
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5266
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5267
readFile:fileName lineDelimiter:aCharacter encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5268
    "read in the file, return its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5269
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5270
     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
  5271
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5272
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5273
    |stream text msg sz|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5274
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5275
    stream := (currentDirectory construct:fileName) readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5276
    stream isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5277
	msg := (resources string:'cannot read file ''%1'' !!' with:fileName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5278
	self showAlert:msg with:(FileStream lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5279
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5280
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5281
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
     for very big files, give ObjectMemory a hint, to preallocate more
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5284
    "
1311
e09e4a65d8a9 filename stuff
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  5285
    (sz := stream fileSize) > 1000000 ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5286
	Processor activeProcess withPriority:Processor userBackgroundPriority do:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5287
	    ObjectMemory announceSpaceNeed:(sz + (sz // 5)) "/ add 20% for tab expansion
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5288
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5289
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5290
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5291
    text := self readStream:stream lineDelimiter:aCharacter encoding:encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5292
    stream close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5293
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5294
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5295
    "Created: 22.2.1996 / 14:56:48 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5296
    "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
  5297
    "Modified: 18.9.1997 / 17:06:54 / stefan"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5298
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5299
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5300
readStream:aStream
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5301
    "read in from aStream, answer its contents as StringCollection"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5302
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5303
    ^ self readStream:aStream lineDelimiter:Character cr encoding:nil
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5304
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5305
    "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
  5306
!
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5307
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5308
readStream:aStream lineDelimiter:aCharacter encoding:encoding 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5309
    "read from aStream, answer its contents as StringCollection. 
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5310
     The files lines are delimited by aCharacter.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5311
     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
  5312
     that symbol, and #decodeString: should be able to convert it."
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5313
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5314
    |text line enc|
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5315
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5316
    text := StringCollection new.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5317
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5318
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5319
    enc == #iso8859 ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5320
	enc := nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5321
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5322
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5323
    aCharacter == Character cr ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5324
	[aStream atEnd] whileFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5325
	    line := aStream nextLine withTabsExpanded.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5326
	    enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5327
		line := line decodeFrom:enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5328
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5329
	    text add:line
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5330
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5331
    ] ifFalse:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5332
	[aStream atEnd] whileFalse:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5333
	    line := (aStream upTo:aCharacter) withTabsExpanded.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5334
	    enc notNil ifTrue:[
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5335
		line := line decodeFrom:enc
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5336
	    ].
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5337
	    text add:line
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5338
	].
633
4630175ed31e double click on .htm / .html files open a viewer;
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
  5339
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5340
    ^ text
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5341
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5342
    "Created: 22.2.1996 / 14:58:25 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5343
    "Modified: 2.4.1997 / 21:31:36 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5344
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5345
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5346
showFile:fileName
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5347
    "show contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5348
1689
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5349
    fileListView selection:(fileList indexOf:fileName).
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5350
    self fileGet
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5351
9795c2b60e94 fixed openOnFileNamed:
Claus Gittinger <cg@exept.de>
parents: 1672
diff changeset
  5352
    "Modified: / 17.6.1998 / 11:26:13 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5353
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5354
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5355
showFile:fileName insert:insert encoding:encoding
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5356
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5357
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5358
    ^ self 
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5359
	showFile:fileName insert:insert encoding:encoding doubleClick:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5360
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5361
    "Modified: 19.6.1996 / 09:40:19 / cg"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5362
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5363
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5364
showFile:fileName insert:insert encoding:encoding doubleClick:viaDoubleClick
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5365
    "show/insert contents of fileName in subView"
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5366
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5367
    |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
  5368
     fontsEncoding pref failWarning|
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5369
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5370
    path := currentDirectory filenameFor:fileName.
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5371
    (path type == #regular) ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5372
	"asked for a non-file  - ignore it ..."
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5373
	path exists ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5374
	    msg := '''%1'' does not exist !!'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5375
	] ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5376
	    msg := '''%1'' is not a regular file !!'.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5377
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5378
	self warn:(resources string:msg with:fileName).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5379
	^ self
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5380
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5381
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5382
    "/
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5383
    "/ check if file is a text file
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5384
    "/
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5385
    s := path readStream.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5386
    s isNil ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5387
	self showAlert:(resources string:'cannot read file ''%1'' !!' with:fileName)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5388
		  with:(FileStream lastErrorString).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5389
	^ nil
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5390
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5391
1222
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5392
    buffer := String new:4096.
f2952fc3ced9 look at more when guessing the encoding
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5393
    n := s nextBytes:4096 into:buffer.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5394
    s close.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5395
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5396
    enc := encoding.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5397
    ok := true.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5398
    guess := self guessEncodingFrom:buffer.
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5399
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5400
    guess == #binary ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5401
	ok := false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5402
	viaDoubleClick ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5403
	    (self binaryFileAction:fileName) ifTrue:[^ self].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5404
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5405
	(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
  5406
	ifFalse:[^ self]
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5407
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5408
	viaDoubleClick ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5409
	    (self nonBinaryFileAction:fileName) ifTrue:[^ self].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5410
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5411
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5412
	fontsEncoding := subView font encoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5413
	pref := self preferredFontEncodingFor:guess.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5414
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5415
	ok := pref match:fontsEncoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5416
	ok ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5417
	    pref = 'iso8859*' ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5418
		ok := 'ascii*' match:fontsEncoding
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5419
	    ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5420
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5421
	ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5422
	    fileEncoding := guess.    
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5423
	    enc := guess.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5424
	] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5425
	    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
  5426
			   labels:(resources array:#('cancel' 'show' 'change font'))
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5427
			   values:#(nil #show #encoding)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5428
			   default:#encoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5429
	    action isNil ifTrue:[^ self].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5430
	    action == #encoding ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5431
		fileEncoding := guess asSymbol.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5432
		subView externalEncoding:fileEncoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5433
		self validateFontEncodingFor:fileEncoding ask:false.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5434
	    ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5435
		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
  5436
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5437
	    enc := fileEncoding.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5438
	].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5439
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5440
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5441
    convert := false.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5442
"/    ok ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5443
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5444
"/        "/ check if line delimiter is a cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5445
"/        "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5446
"/        i := buffer indexOf:Character cr.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5447
"/        i == 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5448
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5449
"/            "/ no newline found - try cr
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5450
"/            "/
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5451
"/            i := buffer indexOf:(Character value:13).
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5452
"/            i ~~ 0 ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5453
"/                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
  5454
"/            ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5455
"/        ]
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5456
"/    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5457
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5458
    insert ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5459
	"/ release old text first 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5460
	"/ - we might need the memory in case of huge files
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5461
	"/  (helps if you have a 4Mb file in the view, 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5462
	"/   and click on another biggy)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5463
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5464
	subView contents:nil.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5465
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5466
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5467
    convert ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5468
	eol := Character value:13
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5469
    ] ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5470
	eol := Character cr
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5471
    ].
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5472
1214
02d5bbd925dd allow decoding errors to be ignored
Claus Gittinger <cg@exept.de>
parents: 1212
diff changeset
  5473
    failWarning := false.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5474
    CharacterArray decodingFailedSignal handle:[:ex |
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5475
	|errStr|
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5476
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5477
	failWarning ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5478
	    errStr := resources string:ex errorString.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5479
	    (self confirm:(resources 
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5480
				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
  5481
				with:errStr) withCRs)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5482
	    ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5483
		^ self
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5484
	    ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5485
	    failWarning := true.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5486
	].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5487
	ex proceed.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5488
    ] do:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5489
	text := self readFile:fileName lineDelimiter:eol encoding:enc.
1212
b6815fefa451 handle decoder errors.
Claus Gittinger <cg@exept.de>
parents: 1209
diff changeset
  5490
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5491
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5492
    insert ifFalse:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5493
	self show:text
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5494
    ] ifTrue:[
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5495
	subView insertSelectedStringAtCursor:text asString
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5496
    ].
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5497
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5498
    "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
  5499
    "Modified: 18.9.1997 / 17:10:20 / stefan"
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5500
    "Modified: 22.9.1997 / 10:02:38 / cg"
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5501
!
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5502
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5503
writeFile:fileName text:someText encoding:encoding
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5504
    |stream errReason msg startNr nLines string|
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5505
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5506
    errReason := ''.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5507
    FileStream streamErrorSignal handle:[:ex |
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5508
	errReason := ex errorString.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5509
	ex return.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5510
    ] do:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5511
	stream := (currentDirectory filenameFor:fileName) writeStream.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5512
    ].
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5513
    stream isNil ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5514
	msg := (resources string:'cannot write file ''%1'' !!' with:fileName).
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5515
	self showAlert:msg with:errReason.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5516
	^ self.
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5517
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5518
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5519
    someText isString ifTrue:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5520
	stream nextPutAll:someText.
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5521
    ] ifFalse:[
1393
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5522
	"/
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5523
	"/ on some systems, writing linewise is very slow (via NFS)
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5524
	"/ therefore we convert to a string and write it in chunks.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5525
	"/ 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
  5526
	"/
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5527
	startNr := 1.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5528
	nLines := someText size.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5529
	[startNr <= nLines] whileTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5530
	    string := someText asStringWithCRsFrom:startNr
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5531
						to:((startNr + 1000) min:nLines)
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5532
				      compressTabs:compressTabs.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5533
	    encoding notNil ifTrue:[
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5534
		string := string encodeInto:encoding
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5535
	    ].
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5536
	    stream nextPutAll:string.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5537
	    startNr := startNr + 1000 + 1.
3aac5b288ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
  5538
	].
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5539
    ].
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5540
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5541
    stream close.
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5542
    subView modified:false
1162
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5543
08940832d3a8 category changes
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  5544
    "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
  5545
    "Modified: 18.9.1997 / 17:12:44 / stefan"
1353
4d07c1f53b3d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
  5546
    "Modified: 22.10.1997 / 12:34:38 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5547
! !
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5548
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5549
!FileBrowser methodsFor:'private - presentation'!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5550
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5551
defineTabulatorsForLongList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5552
    "define the tabs for the long list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5553
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5554
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5555
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5556
"/  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
  5557
    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
  5558
    "                   icon  name   mode  owner  group  size     type"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5559
    tabSpec align:    #(#left #left  #left #right #right #decimal #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5560
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5561
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5562
    tabRulerView tabulatorSpecification:tabSpec.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5563
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5564
    "Modified: 17.4.1997 / 02:56:07 / cg"
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5565
!
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  5566
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5567
defineTabulatorsForShortList
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5568
    "define the tabs for the short list"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5569
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5570
    tabSpec := TabulatorSpecification new.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5571
    tabSpec unit:#inch.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5572
"/  tabSpec positions:#(0     0.25 ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5573
    tabSpec widths:   #(0.25   2   ).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5574
    "                   icon  name"
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5575
    tabSpec align:    #(#left #left).
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5576
    tabSpec addDependent:self.
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5577
1758
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5578
    tabRulerView notNil ifTrue:[
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5579
	tabRulerView tabulatorSpecification:tabSpec.
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5580
    ].
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5581
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5582
    "Created: / 17.4.1997 / 02:51:41 / cg"
a429c5b81d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1757
diff changeset
  5583
    "Modified: / 27.7.1998 / 20:23:34 / cg"
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5584
!
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5585
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5586
iconForFile:aFilenameString
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5587
    "given a fileName, return an appropriate icon"
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5588
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5589
    |f icn key key2 suff mimeType|
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5590
1324
9f016fbbae01 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 1320
diff changeset
  5591
    f := currentDirectory construct:aFilenameString.
1140
56f36855266d nicer directory list.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  5592
    f isDirectory ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5593
	f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5594
	    key := #directoryLink
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5595
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5596
	    key := #directory.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5597
	    (f isReadable not or:[f isExecutable not]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5598
		key := #directoryLocked
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5599
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5600
	]
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5601
    ] ifFalse:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5602
	f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5603
	    f isReadable not ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5604
		key := #fileLocked
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5605
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5606
		key := #fileLink
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5607
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5608
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5609
	    key := key2 := #file.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5610
	    f isExecutableProgram ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5611
		key := key2 := #executableFile
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5612
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5613
	    (f isReadable not) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5614
		key := #fileLocked
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5615
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5616
		suff := f suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5617
		mimeType := MIMETypes mimeTypeForSuffix:suff.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5618
		mimeType notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5619
		    (mimeType startsWith:'image/') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5620
			key := #imageFile
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5621
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5622
			(mimeType startsWith:'text/') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5623
			    key := #textFile
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5624
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5625
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5626
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5627
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5628
	].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  5629
    ].
1147
d0e297f94b9b defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  5630
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5631
    "/ local (device) icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5632
    icons notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5633
	mimeType notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5634
	    icn := icons at:mimeType ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5635
	    icn notNil ifTrue:[^ icn].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5636
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5637
	icn := icons at:key ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5638
	icn notNil ifTrue:[^ icn].
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  5639
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5640
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5641
    "/ global icons
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5642
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5643
    Icons notNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5644
	mimeType notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5645
	    icn := Icons at:mimeType ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5646
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5647
	icn notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5648
	    key := mimeType
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5649
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5650
	    icn := Icons at:key ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5651
	].
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5652
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5653
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  5654
    icn isNil ifTrue:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5655
	(    (key := key2) isNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5656
	 or:[(icn := icons at:key ifAbsent:nil) notNil
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5657
	 or:[(icn := Icons at:key ifAbsent:nil) isNil]]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5658
	) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5659
	    ^ icn
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5660
	]
1253
7f161a49093e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  5661
    ].
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5662
1784
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5663
    "/ remember device icon
329e3a904236 ask MIMETypes when mapping suffixes to icons.
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  5664
    icn := icn copy onDevice:device.
1495
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5665
    icn clearMaskedPixels.
0c0719ee5c20 faster icon drawing
ca
parents: 1493
diff changeset
  5666
    icons at:key put:icn.
1239
e58e2cb6639a allow specification of icons from resource file.
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  5667
    ^ icn
1141
62e6fd3083b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1140
diff changeset
  5668
1746
68a187e3f30f another icon for executable files.
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
  5669
    "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
  5670
    "Modified: / 1.8.1998 / 17:42:37 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5671
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5672
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5673
stopUpdateProcess
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5674
    Processor removeTimedBlock:checkBlock.
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5675
    listUpdateProcess notNil ifTrue:[
1317
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5676
	listUpdateProcess terminate.
da5150d4d2ec mostly filename changes
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  5677
	listUpdateProcess := nil.
1156
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5678
    ].
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5679
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5680
    "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
  5681
!
f3df28086973 dont do a full update when removing files
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
  5682
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5683
updateCurrentDirectory
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5684
    "update listView with directory contents"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  5685
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5686
    "the code below may look somewhat complex -
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5687
     it reads the directory first for the names,
1151
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  5688
     then (in followup sweeps over the files) gets the
194b10bad6da great asynchronous list update;
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  5689
     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
  5690
     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
  5691
     (i.e. stat-calls) may take long - especially on NFS-mounted directories.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5692
     The file reading is done at lower priority, to let user continue
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5693
     his work in other views. However, to be fair to other fileBrowser,
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5694
     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
  5695
     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
  5696
     Therefore, browsers which read short directories will finish first.
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5697
     ST/X users love this behavior ;-)
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5698
    "
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  5699
294
a693bd6d7ae6 read cursor while reading
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  5700
    self withReadCursorDo:[
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5701
	|files matchPattern list passDone f|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5702
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5703
	self stopUpdateProcess.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5704
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5705
	timeOfLastCheck := AbsoluteTime now.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5706
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5707
	files := currentDirectory asFilename fullDirectoryContents.
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5708
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5709
"/        (files includes:(Filename parentDirectoryName)) ifTrue:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5710
"/            upButton enable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5711
"/        ] ifFalse:[
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5712
"/            upButton disable.
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5713
"/        ].
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  5714
1868
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5715
	"/ show files which are either directories
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5716
	"/ or match the current pattern
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
	matchPattern := filterField contents.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5719
	(matchPattern notNil and:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5720
	 matchPattern isEmpty not and:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5721
	 matchPattern ~= '*']]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5722
	     files := files select:[:aName | 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5723
			 ((currentDirectory construct:aName) isDirectory)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5724
			 or:[matchPattern compoundMatch:aName]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5725
		      ].
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
	files size == 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5729
	    self information:('directory ', currentDirectory pathName, ' vanished').
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5730
	    ^ self
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
	(sortByWhat value == #name) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5733
	    sortCaseless value == true ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5734
		files sort:[:a :b | a asLowercase < b asLowercase]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5735
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5736
		files sort.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5737
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5738
	] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5739
	    (sortByWhat value == #time) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5740
		files sort:[:a :b | |f1 f2 t1 t2|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5741
				f1 := (currentDirectory construct:a).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5742
				f2 := (currentDirectory construct:b).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5743
				t1 := f1 isSymbolicLink 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5744
					ifFalse:[f1 modificationTime]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5745
					ifTrue:[f1 linkInfo modified].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5746
				t2 := f2 isSymbolicLink 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5747
					ifFalse:[f2 modificationTime]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5748
					ifTrue:[f2 linkInfo modified].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5749
				t1 := t1 ? (AbsoluteTime now).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5750
				t2 := t2 ? (AbsoluteTime now).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5751
				t1 > t2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5752
			   ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5753
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5754
		(sortByWhat value == #type) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5755
		    files sort:[:a :b | |f1 f2 t1 t2 suff1 suff2|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5756
				    f1 := (currentDirectory construct:a).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5757
				    f2 := (currentDirectory construct:b).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5758
				    t1 := f1 type ? #xbadLink. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5759
				    t2 := f2 type ? #xbadLink. 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5760
				    t1 = t2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5761
					suff1 := f1 suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5762
					suff2 := f2 suffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5763
					suff1 = suff2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5764
					    sortCaseless value == true ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5765
						a asLowercase < b asLowercase
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5766
					    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5767
						a < b
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5768
					    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5769
					] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5770
					    suff1 asLowercase < suff2 asLowercase
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5771
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5772
				    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5773
					t1 < t2
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5774
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5775
			       ]
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
	    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5778
	].
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
	files := self withoutHiddenFiles:files.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5781
	fileList := files copy.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5782
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5783
	tabSpec isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5784
	    showingDetails value "showLongList" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5785
		self defineTabulatorsForLongList
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5786
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5787
		self defineTabulatorsForShortList
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
	].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5790
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
	"/ first show all the names - this can be done fast ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5793
	"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5794
	list := files collect:[:fileName |
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5795
		    |entry|
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5796
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5797
		    entry := MultiColListEntry new.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5798
		    entry tabulatorSpecification:tabSpec.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5799
		    entry colAt:1 put:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5800
		    entry colAt:2 put:fileName.
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
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5803
	fileListView setList:list expandTabs:false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5804
	passDone := Array new:list size withAll:0.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5805
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
	 this is a time consuming operation (especially, if reading an
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5808
	 NFS-mounted directory); therefore, start a low prio process,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5809
	 which fills in the remaining fields in the fileList ...
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
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5812
	listUpdateProcess := [
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5813
	    |prevUid prevGid fileNameString nameString groupString 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5814
	     modeString info line len
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5815
	     anyImages lineIndex aFileName
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5816
	     entry typ f p typeString done endIndex 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5817
	     state stopAtEnd nextState img prevFirstLine prevLastLine
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5818
	     numVisible dirSuffix|
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
	    dirSuffix := Filename directorySuffix.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5821
	    dirSuffix size > 0 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5822
		dirSuffix := '.' , dirSuffix asLowercase.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5823
	    ].
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
	    "/ then walk over the files, adding more info
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5827
	    "/ (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
  5828
	    "/ Visible items are always filled first.
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
	    "/ the state machine
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5832
	    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5833
	    nextState := IdentityDictionary new.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5834
	    showingDetails value "showLongList" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5835
		nextState add:(#visibleIcons -> #visibleAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5836
		nextState add:(#visibleAttributes -> #visibleTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5837
		nextState add:(#visibleTypes -> #visibleImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5838
		nextState add:(#visibleImages -> #nextPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5839
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5840
		nextState add:(#nextPageIcons -> #nextPageAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5841
		nextState add:(#nextPageAttributes -> #nextPageTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5842
		nextState add:(#nextPageTypes -> #nextPageImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5843
		nextState add:(#nextPageImages -> #previousPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5844
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5845
		nextState add:(#previousPageIcons -> #previousPageAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5846
		nextState add:(#previousPageAttributes -> #previousPageTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5847
		nextState add:(#previousPageTypes -> #previousPageImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5848
		nextState add:(#previousPageImages -> #remainingIcons).
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
		nextState add:(#remainingIcons -> #remainingAttributes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5851
		nextState add:(#remainingAttributes -> #remainingTypes).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5852
		nextState add:(#remainingTypes -> #remainingImages).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5853
		nextState add:(#remainingImages -> nil).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5854
	    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5855
		nextState add:(#visibleIcons -> #nextPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5856
		nextState add:(#nextPageIcons -> #previousPageIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5857
		nextState add:(#previousPageIcons -> #remainingIcons).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5858
		nextState add:(#remainingIcons -> nil).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5859
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5860
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5861
	    anyImages := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5862
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5863
	    lineIndex := prevFirstLine := fileListView firstLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5864
	    endIndex := prevLastLine := fileListView lastLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5865
	    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5866
	    state := #visibleIcons.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5867
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5868
	    done := false.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5869
	    [done] whileFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5870
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5871
		"/ if multiple FileBrowsers are reading, let others
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5872
		"/ make some progress too
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5873
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5874
		Processor yield.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5875
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5876
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5877
		"/ could be destroyed in the meanwhile ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5878
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5879
		realized ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5880
		    listUpdateProcess := nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5881
		    Processor activeProcess terminate
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5882
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5883
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5884
		((prevFirstLine ~~ fileListView firstLineShown)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5885
		or:[prevLastLine ~~ fileListView lastLineShown]) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5886
		    "/ start all over again
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5887
		    lineIndex := prevFirstLine := fileListView firstLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5888
		    endIndex := prevLastLine := fileListView lastLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5889
		    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5890
		    state := #visibleIcons.
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
		(lineIndex between:1 and:(files size)) ifTrue:[
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
		    "/ expand the next entry ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5897
		    "/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5898
		    aFileName := files at:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5899
		    entry := fileListView at:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5900
		    f := currentDirectory construct:aFileName.
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
		    (state endsWith:'Icons') ifTrue:[
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
			"/ pass 1 - icons
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5905
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5906
			(passDone at:lineIndex) < 1 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5907
			    (f isDirectory
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5908
			      and:[(aFileName ~= '..') and:[aFileName ~= '.']]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5909
			    ) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5910
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5911
				"/ the following suffix cutOff is not really required, 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5912
				"/ but makes the list look better on VMS ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5913
				fileNameString := aFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5914
				dirSuffix notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5915
				    (aFileName asLowercase endsWith:dirSuffix) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5916
					fileNameString := aFileName copyWithoutLast:(dirSuffix size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5917
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5918
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5919
				fileNameString := fileNameString , ' ...'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5920
			    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5921
				fileNameString := aFileName.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5922
				OperatingSystem isVMSlike ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5923
				    (aFileName endsWith:'.') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5924
					aFileName ~= '..' ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5925
					    fileNameString := aFileName copyWithoutLast:1
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5926
					]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5927
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5928
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5929
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5930
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5931
			    showingDetails value "showLongList" ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5932
				len := fileNameString size.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5933
				(len > 20) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5934
				    fileNameString := (fileNameString contractTo:20)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5935
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5936
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5937
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5938
			    entry colAt:1 put:(self iconForFile:aFileName).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5939
			    entry colAt:2 put:fileNameString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5940
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5941
			    "/fileListView at:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5942
			    fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5943
			    fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5944
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5945
			    anyImages ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5946
				(Image isImageFileSuffix:(aFileName asFilename suffix))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5947
				ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5948
				    anyImages := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5949
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5950
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5951
			    passDone at:lineIndex put:1
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5952
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5953
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5954
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5955
		    (state endsWith:'Attributes') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5956
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5957
			"/ pass 2 - everything except fileType (which takes very long)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5958
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5959
			(passDone at:lineIndex) < 2 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5960
			    info := f info.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5961
			    info isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5962
				"not accessable - usually a symlink,
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5963
				 to a nonexisting/nonreadable file
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5964
				"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5965
				f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5966
				    p := f linkInfo path.    
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5967
				    typeString := 'broken symbolic link to ' , p
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5968
				] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5969
				    typeString := 'unknown'
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5970
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5971
			    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5972
				typ := (info type).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5973
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5974
				modeString := self getModeString:(info at:#mode)
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5975
							    with:#( '' $r $w $x 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5976
								    '  ' $r $w $x 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5977
								    '  ' $r $w $x ).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5978
				entry colAt:3 put:modeString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5979
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5980
				((info uid) ~~ prevUid) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5981
				    prevUid := (info uid).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5982
				    nameString := OperatingSystem getUserNameFromID:prevUid.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5983
				    nameString := nameString contractTo:10.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5984
				    nameString := nameString , (String new:(10 - nameString size))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5985
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5986
				nameString isNil ifTrue:[nameString := '???'].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5987
				entry colAt:4 put:nameString withoutSpaces.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5988
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5989
				((info gid) ~~ prevGid) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5990
				    prevGid := (info gid).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5991
				    groupString := OperatingSystem getGroupNameFromID:prevGid.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5992
				    groupString := groupString contractTo:10.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5993
				    groupString := groupString , (String new:(10 - groupString size))
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5994
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5995
				groupString isNil ifTrue:[groupString := '???'].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5996
				entry colAt:5 put:groupString withoutSpaces.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5997
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5998
				(typ == #regular) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  5999
				    entry colAt:6 put:(self sizePrintString:(info size)).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6000
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6001
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6002
				f isSymbolicLink ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6003
				    p := f linkInfo path.    
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6004
				    typeString := 'symbolic link to ' , p
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6005
				] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6006
				    typeString := typ asString
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6007
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6008
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6009
			    entry colAt:7 put:typeString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6010
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6011
			    "/ fileListView at:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6012
			    fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6013
			    fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6014
			    passDone at:lineIndex put:2.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6015
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6016
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6017
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6018
		    (state endsWith:'Types') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6019
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6020
			"/ pass 3: add fileType
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6021
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6022
			(passDone at:lineIndex) < 3 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6023
			    info := f info.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6024
			    info notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6025
				f isSymbolicLink ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6026
				    (Image isImageFileSuffix:(f suffix)) ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6027
					typeString := f fileType.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6028
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6029
					entry colAt:7 put:typeString.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6030
					"/ fileListView at:lineIndex put:entry
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6031
					fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6032
					fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6033
				    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6034
				].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6035
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6036
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6037
			    passDone at:lineIndex put:3
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6038
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6039
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6040
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6041
		    (state endsWith:'Images') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6042
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6043
			"/ pass 4: read images
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6044
			"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6045
			(passDone at:lineIndex) < 4 ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6046
			    (Image isImageFileSuffix:(f suffix)) ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6047
				f isDirectory ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6048
				    img := Image fromFile:(f pathName).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6049
				    img notNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6050
					img := img magnifiedTo:16@16.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6051
					img := img on:self device.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6052
					entry colAt:7 put:img.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6053
					"/ fileListView at:lineIndex put:entry
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6054
					fileListView withoutRedrawAt:lineIndex put:entry.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6055
					fileListView invalidateLine:lineIndex.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6056
				    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6057
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6058
			    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6059
			    passDone at:lineIndex put:4
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6060
			].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6061
		    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6062
		].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6063
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6064
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6065
		"/ advance to the next line
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6066
		"/
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6067
		lineIndex := lineIndex + 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6068
		lineIndex > endIndex ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6069
		    "/ finished this round ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6070
		    "/ see what we are going for ...
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6071
		    numVisible := (fileListView lastLineShown - fileListView firstLineShown + 1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6072
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6073
		    state := nextState at:state ifAbsent:nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6074
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6075
		    state isNil ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6076
			done := true
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6077
		    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6078
			(state startsWith:'visible') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6079
			    lineIndex := fileListView firstLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6080
			    endIndex := fileListView lastLineShown.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6081
			    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6082
			] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6083
			    (state startsWith:'nextPage') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6084
				lineIndex := fileListView lastLineShown + 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6085
				endIndex := lineIndex + numVisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6086
				endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6087
				lineIndex := lineIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6088
			    ] ifFalse:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6089
				(state startsWith:'previousPage') ifTrue:[
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6090
				    endIndex := fileListView firstLineShown - 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6091
				    lineIndex := endIndex - numVisible.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6092
				    lineIndex := lineIndex max:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6093
				    endIndex := endIndex min:(files size).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6094
				    endIndex := endIndex max:1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6095
				] ifFalse:[ 
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6096
				    "/ remaining
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6097
				    lineIndex := 1.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6098
				    endIndex := files size.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6099
				]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6100
			    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6101
			]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6102
		    ]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6103
		]
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6104
	    ].
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6105
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6106
	    listUpdateProcess := nil.
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6107
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6108
	] forkAt:(Processor activePriority - 1).
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6109
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6110
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6111
	 install a new check after some time
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6112
	"
528b1549b065 more bells & whistles
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  6113
	Processor addTimedBlock:checkBlock afterSeconds:checkDelta
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
  6114
    ]
142
claus
parents: 139
diff changeset
  6115
1487
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  6116
    "Modified: / 21.9.1995 / 11:40:23 / claus"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  6117
    "Modified: / 28.4.1997 / 22:30:30 / dq"
c8d32d8b039c oops - dont sort a nil object
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  6118
    "Modified: / 18.9.1997 / 18:28:30 / stefan"
1834
1c0681c82eae added a pullDown menu.
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  6119
    "Modified: / 14.8.1998 / 17:59:06 / cg"
386
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  6120
! !
3fd24d9116b3 added encodings (experimental)
Claus Gittinger <cg@exept.de>
parents: 381
diff changeset
  6121
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6122
!FileBrowser methodsFor:'queries'!
73
e332d9c71624 *** empty log message ***
claus
parents: 67
diff changeset
  6123
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6124
fileName
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6125
    "return my current fileName - during fileIn, the file
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6126
     which is being loaded is returned.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6127
     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
  6128
     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
  6129
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6130
    |f|
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6131
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6132
    f := currentFileInFileName ? currentFileName.
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6133
    f isNil ifTrue:[^ nil].
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6134
    ^ self path asFilename construct:f
1700
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6135
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6136
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6137
     (FileBrowser openOnFileNamed:'Makefile') fileName
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6138
    "
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6139
1702
962056a31c06 remember the current file during fileIn,
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
  6140
    "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
  6141
!
5067b3c4cafa added access to fileName (kludge to fileIn RefactoryBrowser)
Claus Gittinger <cg@exept.de>
parents: 1689
diff changeset
  6142
172
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6143
path
3578af8feec6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
  6144
    "return my currentDirectories pathName;
1329
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6145
     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
  6146
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6147
    "/ somewhat tricky: first ask it for the full pathName,
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6148
    "/ then convert it to a directory name
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6149
    "/ (which only makes a difference on VMS)
c443b87bbe21 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
  6150
1828
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  6151
    ^ currentDirectory asFilename pathName "/ asFilename osNameForDirectory
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  6152
afb2a1533571 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  6153
    "Modified: / 12.8.1998 / 14:45:48 / cg"
49
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6154
! !
6fe62433cfa3 *** empty log message ***
claus
parents: 47
diff changeset
  6155
763
94a8d188b52d care for the nameSpace Query when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  6156
!FileBrowser class methodsFor:'documentation'!
203
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  6157
de8d39d459fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 172
diff changeset
  6158
version
1981
a9cced5a1449 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1976
diff changeset
  6159
    ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.284 1999-01-20 21:51:29 cg Exp $'
381
0b715d777c48 slight cleanup
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
  6160
! !