AbstractFileBrowser.st
author Stefan Vogel <sv@exept.de>
Wed, 11 Jul 2018 12:07:57 +0200
changeset 18264 4bf515143c81
parent 18248 0e0b4a81b2a4
child 18274 78c789c6c2bf
permissions -rw-r--r--
#REFACTORING by stefan class: AbstractFileBrowser class changed: #initialCommandFor:in:intoBox:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     1
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     3
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     4
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     5
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     6
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     8
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     9
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    10
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    11
"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    12
"{ Package: 'stx:libtool' }"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    13
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    14
"{ NameSpace: Smalltalk }"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    15
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    16
ApplicationModel subclass:#AbstractFileBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    17
	instanceVariableNames:'aspects'
16720
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    18
	classVariableNames:'CommandHistory CommandHistorySize DefaultCommandPerSuffix
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    19
		DefaultFilters DirectoryBookmarks LastEnforcedNameSpace
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    20
		LastFileDiffDirectory LastFileDiffFile LastFileSelection
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    21
		LastMercurialRepository LastMoveDestination LastMustMatchPattern
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    22
		LastScriptBlockString RootHolder RuntimeAspects
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
    23
		VisitedDirectories MaxFileSizeShownWithoutAsking'
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    24
	poolDictionaries:''
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    25
	category:'Interface-Tools-File'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    26
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    27
321c1729db5b initial checkin
penk
parents:
diff changeset
    28
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage'
321c1729db5b initial checkin
penk
parents:
diff changeset
    29
321c1729db5b initial checkin
penk
parents:
diff changeset
    30
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    31
 The following class instance variables are inherited by this class:
321c1729db5b initial checkin
penk
parents:
diff changeset
    32
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    33
	ApplicationModel - ClassResources
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    34
	Model - 
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    35
	Object - 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    36
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    37
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    38
321c1729db5b initial checkin
penk
parents:
diff changeset
    39
Object subclass:#Clipboard
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    40
	instanceVariableNames:'method files'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    41
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    42
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    43
	privateIn:AbstractFileBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    44
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    45
321c1729db5b initial checkin
penk
parents:
diff changeset
    46
Object subclass:#CodeExecutionLock
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    47
	instanceVariableNames:'locked'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    48
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    49
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    50
	privateIn:AbstractFileBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    51
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    52
4366
97a0311a9539 *** empty log message ***
penk
parents: 4358
diff changeset
    53
List subclass:#DirectoryHistory
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    54
	instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    55
		backForwardList backForwardIndex historySize'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    56
	classVariableNames:'HistorySize'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    57
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    58
	privateIn:AbstractFileBrowser
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
    59
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
    60
c04d4781a37e next stage
penk
parents: 3949
diff changeset
    61
Object subclass:#DirectoryHistoryItem
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    62
	instanceVariableNames:'path position'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    63
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    64
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    65
	privateIn:AbstractFileBrowser::DirectoryHistory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    66
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    67
321c1729db5b initial checkin
penk
parents:
diff changeset
    68
Object subclass:#SaveAspectItem
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    69
	instanceVariableNames:'value isHolder'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    70
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    71
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    72
	privateIn:AbstractFileBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    73
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    74
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    75
!AbstractFileBrowser class methodsFor:'documentation'!
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    76
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    77
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    78
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    79
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    80
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    81
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    82
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    83
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    84
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    85
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    86
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    87
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    88
"
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    89
!
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    90
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    91
documentation
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    92
"
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    93
    [Author:]
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    94
        Christian Penk
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    95
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    96
    Notice: this certainly needs a redesign - all those abstract-abstract classes which
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    97
    define stuff which is only needed in some parts makes this hard to understand.
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    98
    Especially the fact, that AbstractFileBrowser defines things both as abstract superclass
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    99
    and as a container is almost incomprehensable...
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   100
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   101
    [class variables:]
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   102
        CommandHistory 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   103
        CommandHistorySize 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   104
        DefaultCommandPerSuffix
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   105
        DefaultFilters 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   106
        DirectoryBookmarks 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   107
        LastEnforcedNameSpace
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   108
        LastFileDiffDirectory 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   109
        LastFileDiffFile 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   110
        LastFileSelection
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   111
        LastMercurialRepository 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   112
        LastMoveDestination 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   113
        LastMustMatchPattern
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   114
        LastScriptBlockString 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   115
        RootHolder 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   116
        RuntimeAspects
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   117
        VisitedDirectories 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   118
        MaxFileSizeShownWithoutAsking ..... for big files, I will ask if only the first part is
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   119
                                            to be shown. This number (if non-nil) suppresses this
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   120
                                            question for files smaller.
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   121
                                            The initial default is 1Mb (1024*1024)
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
   122
"
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
   123
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   124
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   125
!AbstractFileBrowser class methodsFor:'accessing'!
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   126
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   127
currentSelection
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   128
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   129
    LastFileSelection isNil ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   130
        LastFileSelection := #().
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   131
    ].
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   132
    ^ LastFileSelection
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   133
!
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   134
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   135
currentSelection:aFilenameCol
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
   136
    aFilenameCol notEmptyOrNil ifTrue:[
12102
9512a4336434 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12094
diff changeset
   137
        LastFileSelection := aFilenameCol collect:[:file | (file ? '') asFilename]
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
   138
    ]
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   139
!
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   140
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   141
directoryHistory
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   142
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   143
    VisitedDirectories isNil ifTrue:[
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   144
        VisitedDirectories := self directoryHistoryClass new.
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   145
        "/ VisitedDirectories inspect.
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   146
    ].
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   147
    ^ VisitedDirectories
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   148
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   149
    "Modified: / 21-11-2012 / 08:45:49 / cg"
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   150
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   151
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   152
maxFileSizeShownWithoutAsking
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   153
    "the max. filesize which is loaded without asking if only the first
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   154
     part should be shown"
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   155
     
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   156
    ^ MaxFileSizeShownWithoutAsking ? (1024*1024)
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   157
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   158
    "Created: / 19-11-2017 / 14:48:19 / cg"
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   159
!
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   160
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   161
maxFileSizeShownWithoutAsking:anIntegerOrNilForDefault
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   162
    "the max. filesize which is loaded without asking if only the first
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   163
     part should be shown.
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   164
     Nil resets to the default (currently 1Mb)"
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   165
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   166
    MaxFileSizeShownWithoutAsking := anIntegerOrNilForDefault
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   167
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   168
    "
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   169
     self maxFileSizeShownWithoutAsking:nil
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   170
    "
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   171
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   172
    "Created: / 19-11-2017 / 14:48:45 / cg"
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   173
!
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   174
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   175
resetClassVars
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   176
    VisitedDirectories := nil.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   177
    LastFileSelection := nil.
5936
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   178
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   179
    "
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   180
     AbstractFileBrowser resetClassVars
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   181
    "
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   182
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   183
    "Modified: / 21-11-2012 / 08:45:53 / cg"
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   184
!
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   185
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   186
rootHolder
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   187
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   188
    ^ RootHolder
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   189
!
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   190
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   191
rootHolder:aRoot
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   192
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   193
    RootHolder := aRoot
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   194
! !
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   195
4915
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
   196
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'!
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   197
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   198
addBookmark:aDirectoryPath
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   199
    "add aDirectoryPath to the list of our known bookmarks.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   200
     Do not add duplicates."
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   201
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   202
    |bookmarks|
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   203
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   204
    bookmarks := self directoryBookmarks.
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   205
    (bookmarks includes:aDirectoryPath) ifFalse:[
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   206
        bookmarks add:aDirectoryPath asFilename.
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   207
    ].
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   208
!
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   209
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   210
bookmarksFrom:aFileNameOrString
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   211
    |bookmarks s fileName line|
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   212
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   213
    fileName := aFileNameOrString asFilename.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   214
    [
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   215
        s := fileName readStream.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   216
    ] on:OpenError do:[:ex|
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   217
        ^ nil.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   218
    ].
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   219
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   220
    bookmarks := OrderedCollection new.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   221
    [s atEnd] whileFalse:[
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   222
        line := s nextLine.
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   223
        (line startsWith:';') ifFalse:[
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   224
            bookmarks add:(Base64Coder decode:line) asString.
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   225
        ]
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   226
    ].
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   227
    s close.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   228
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   229
    ^ bookmarks
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   230
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   231
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   232
defaultBookMarksFileDirectory
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   233
    "the directory, where the default bookmarks are stored (as defaultBookMarksFilename)"
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   234
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
   235
    ^ Filename homeDirectory
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   236
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   237
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   238
defaultBookMarksFilename
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   239
    "the filename, in which the default bookmarks are stored (in defaultBookMarksDirectory)"
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   240
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   241
    ^ '.fileBrowserBookmarks'
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   242
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   243
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   244
directoryBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   245
    DirectoryBookmarks isNil ifTrue:[                     
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
   246
        self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename).
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   247
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   248
        DirectoryBookmarks isEmptyOrNil ifTrue:[
17979
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   249
            DirectoryBookmarks := 
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   250
                OrderedCollection 
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   251
                    with:(Filename homeDirectory asAbsoluteFilename)
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   252
                    with:(Filename currentDirectory asAbsoluteFilename).
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   253
        ]
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   254
    ].
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   255
    ^ DirectoryBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   256
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   257
    "
5438
fa19d526d85d directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents: 5437
diff changeset
   258
     DirectoryBookmarks := nil.
fa19d526d85d directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents: 5437
diff changeset
   259
     self directoryBookmarks.
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   260
    "
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   261
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   262
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   263
directoryBookmarks: collectionOfFilenames
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   264
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   265
    DirectoryBookmarks := collectionOfFilenames.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   266
    self saveBookmarksInDefaultBookmarksFile.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   267
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   268
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   269
editBookmarksWithDefault: aFilenameOrNil
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   270
    | oldBookmarks newBookmarks |
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   271
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   272
    oldBookmarks := self directoryBookmarks copy.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   273
    newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   274
    newBookmarks isNil ifTrue:[^ self].
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   275
    self directoryBookmarks: newBookmarks.
9681
00195b8c6cf6 comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents: 9677
diff changeset
   276
00195b8c6cf6 comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents: 9677
diff changeset
   277
    "Modified: / 13-01-2011 / 12:52:28 / cg"
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   278
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   279
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   280
hasBookmarks
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
   281
    ^ self directoryBookmarks notEmptyOrNil
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   282
!
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   283
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   284
loadBookmarksFrom:aFileNameOrString
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   285
    |bookmarks|
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   286
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   287
    bookmarks := self bookmarksFrom: aFileNameOrString.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   288
    bookmarks isNil ifTrue:[^ self].
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   289
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   290
    DirectoryBookmarks := OrderedCollection new.
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   291
    bookmarks do:[:eachPath |
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   292
        self addBookmark:eachPath asFilename
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   293
    ].
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   294
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   295
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   296
removeBookmark:aDirectoryPath
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   297
    |bookmarks|
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   298
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   299
    bookmarks := self directoryBookmarks.
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   300
    bookmarks isEmptyOrNil ifTrue:[ ^ self].
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   301
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   302
    bookmarks remove:aDirectoryPath ifAbsent:[].
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   303
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   304
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   305
saveBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   306
    |fn|
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   307
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   308
    fn := Dialog 
9607
63f0d2689895 changed: #saveBookmarks
Claus Gittinger <cg@exept.de>
parents: 9599
diff changeset
   309
            requestFileNameForSave:(self resources string:'Save Bookmarks')
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   310
            default:(self defaultBookMarksFilename)
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   311
            fromDirectory:(self defaultBookMarksFileDirectory).
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   312
    fn isEmptyOrNil ifTrue:[^ self].
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   313
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   314
    self saveBookmarksIn:fn
9607
63f0d2689895 changed: #saveBookmarks
Claus Gittinger <cg@exept.de>
parents: 9599
diff changeset
   315
63f0d2689895 changed: #saveBookmarks
Claus Gittinger <cg@exept.de>
parents: 9599
diff changeset
   316
    "Modified: / 27-10-2010 / 11:27:09 / cg"
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   317
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   318
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   319
saveBookmarks: bookmarks in:aFileNameOrString
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   320
    "save the bokmarks in aFileNameOrString.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   321
     Use Base64 coding"
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   322
13683
e31bd21c4760 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13677
diff changeset
   323
    |bookmarkStream fileName coder|
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   324
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   325
    fileName := aFileNameOrString asFilename.
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   326
    fileName exists ifTrue:[
13683
e31bd21c4760 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13677
diff changeset
   327
        fileName renameTo:(fileName addSuffix:'sav').
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   328
    ].
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   329
    bookmarkStream := fileName writeStream.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   330
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   331
    "save each bookmark in one line"
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   332
    coder := (Base64Coder on:bookmarkStream) lineLimit:nil.
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   333
    bookmarks do:[:eachPath |
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   334
        eachPath asFilename pathName acceptVisitor:coder.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   335
        coder flush.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   336
        bookmarkStream cr.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   337
    ].
12391
87ca5c4d1270 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12390
diff changeset
   338
    bookmarkStream syncData; close.
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   339
!
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   340
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   341
saveBookmarksIn:aFileNameOrString
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   342
    "save the bokmarks in aFileNameOrString.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   343
     Use Base64 coding"
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   344
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   345
    | bookmarks |
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   346
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   347
    bookmarks := self directoryBookmarks.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   348
    self saveBookmarks: bookmarks in:aFileNameOrString
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   349
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   350
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   351
saveBookmarksInDefaultBookmarksFile
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   352
    self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename)
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   353
! !
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   354
4915
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
   355
!AbstractFileBrowser class methodsFor:'accessing-classes'!
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   356
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   357
directoryHistoryClass
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   358
    ^ DirectoryHistory
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   359
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   360
    "Modified: / 21-11-2012 / 08:46:34 / cg"
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   361
! !
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   362
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   363
!AbstractFileBrowser class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   364
321c1729db5b initial checkin
penk
parents:
diff changeset
   365
commandHistory
321c1729db5b initial checkin
penk
parents:
diff changeset
   366
321c1729db5b initial checkin
penk
parents:
diff changeset
   367
    CommandHistory isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   368
        CommandHistory := OrderedCollection new.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   369
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   370
    ^ CommandHistory
321c1729db5b initial checkin
penk
parents:
diff changeset
   371
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   372
321c1729db5b initial checkin
penk
parents:
diff changeset
   373
commandHistorySize
4190
4b0ea23f558e *** empty log message ***
penk
parents: 4189
diff changeset
   374
    "max no of entries in the HistoryList "
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
   375
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   376
    CommandHistorySize isNil ifTrue:[
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
   377
        CommandHistorySize := 150
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   378
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   379
    ^ CommandHistorySize
321c1729db5b initial checkin
penk
parents:
diff changeset
   380
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   381
321c1729db5b initial checkin
penk
parents:
diff changeset
   382
defaultFilterList
321c1729db5b initial checkin
penk
parents:
diff changeset
   383
321c1729db5b initial checkin
penk
parents:
diff changeset
   384
    DefaultFilters isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   385
        DefaultFilters := #(        '*'
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   386
                                    '*.st' 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   387
                                    '*.[h,c]*' 
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   388
                                    '*.txt; *.htm*' 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   389
                                    '*.gif; *.xpm; *.jpg; *.png' 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   390
                                    '~*o; ~*.obj; ~*.dll;' 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   391
                                )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   392
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   393
    ^ DefaultFilters.
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   394
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   395
    "
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   396
     DefaultFilters := nil
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   397
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   398
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   399
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   400
initialCommandFor:fileName in:aDirectory intoBox:aBox
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   401
    "set a useful initial command in an execute box."
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   402
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   403
    |mime cmd select path suffix baseName pathName|
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   404
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   405
    path := aDirectory filenameFor:fileName.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   406
    baseName := path baseName.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   407
    suffix := path suffix.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   408
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   409
    cmd := UserPreferences current defaultFileOpenCommandFor:suffix.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   410
    cmd notNil ifTrue:[
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   411
        aBox initialText:(cmd bindWith:fileName pathName).
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   412
        ^ self
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   413
    ].
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   414
    
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   415
    mime := MIMETypes mimeTypeForSuffix:suffix.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   416
"/    mime notNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   417
"/        cmd := self initialCommandForMIME:mime file:path
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   418
"/    ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   419
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   420
    "/ XXX should be changed to take stuff from a config file
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   421
    "/ XXX or from resources.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   422
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   423
    (path type == #regular) ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   424
        path isExecutableProgram ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   425
            aBox initialText:(path pathName , ' <arguments>').
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   426
            ^ self
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   427
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   428
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   429
        select := true.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   430
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   431
        "some heuristics - my personal preferences ...
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   432
         (actually this should come from a configfile)"
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   433
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   434
        (baseName endsWith:'akefile') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   435
            aBox initialText:'make target' selectFrom:6 to:11.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   436
            ^ self
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   437
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   438
18264
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   439
        cmd := MIMETypes defaultCommandTemplateToOpenMimeType:mime.
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   440
        cmd notNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   441
            select := false
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   442
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   443
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   444
        cmd isNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   445
            suffix := path suffix.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   446
            (suffix = 'C') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   447
                cmd := 'g++ -c %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   448
                select := 6.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   449
            ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   450
                suffix := suffix asLowercase.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   451
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   452
                (suffix = 'taz') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   453
                    aBox initialText:'zcat %1 | tar tvf -'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   454
                    select := false.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   455
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   456
                (suffix = 'tar') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   457
                    cmd := 'tar tvf %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   458
                    select := 7.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   459
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   460
                (suffix = 'zoo') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   461
                    cmd := 'zoo -list %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   462
                    select := 9.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   463
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   464
                (suffix = 'zip') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   465
                    cmd := 'unzip -l %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   466
                    select := 8.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   467
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   468
                (suffix = 'jar') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   469
                    cmd := 'unzip -l %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   470
                    select := 8.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   471
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   472
                (suffix = 'z') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   473
                    (baseName asLowercase endsWith:'tar.z') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   474
                        cmd := 'zcat %1 | tar tvf -'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   475
                        select := false.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   476
                    ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   477
                        cmd := 'uncompress %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   478
                    ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   479
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   480
                (suffix = 'gz') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   481
                    (baseName asLowercase endsWith:'tar.gz') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   482
                        cmd := ('gunzip < %1 | tar tvf -' ).
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   483
                        select := false.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   484
                    ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   485
                        cmd := 'gunzip %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   486
                    ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   487
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   488
                (suffix = 'html') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   489
                    cmd := 'netscape %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   490
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   491
                (suffix = 'htm') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   492
                    cmd := 'netscape %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   493
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   494
                (suffix = 'uue') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   495
                    cmd := 'uudecode %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   496
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   497
                (suffix = 'c') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   498
                    cmd := 'cc -c %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   499
                    select := 5.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   500
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   501
                (suffix = 'cc') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   502
                    cmd := 'g++ -c %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   503
                    select := 6.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   504
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   505
                (suffix = 'xbm') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   506
                    cmd := 'bitmap %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   507
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   508
                (suffix = 'ps') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   509
                    cmd := 'ghostview %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   510
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   511
                ((suffix = '1') or:[suffix = 'man']) ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   512
                    cmd := 'nroff -man %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   513
                    select := 10.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   514
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   515
            ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   516
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   517
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   518
        cmd isNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   519
            DefaultCommandPerSuffix isNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   520
                cmd := '<cmd>'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   521
            ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   522
                cmd := DefaultCommandPerSuffix 
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   523
                        at:suffix
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   524
                        ifAbsent:'<cmd>'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   525
            ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   526
            cmd := cmd , ' %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   527
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   528
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   529
        pathName := path pathName.
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   530
        OperatingSystem isUNIXlike ifTrue:[
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   531
            pathName includesSeparator ifTrue:[
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   532
                pathName := '"' , pathName , '"'
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   533
            ]
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   534
        ].
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   535
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   536
        cmd := cmd bindWith:pathName.
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   537
        select == false ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   538
            aBox initialText:cmd
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   539
        ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   540
            select class == Interval ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   541
                aBox initialText:cmd selectFrom:select start to:select stop
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   542
            ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   543
                select isInteger ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   544
                    select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   545
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   546
                aBox initialText:cmd selectFrom:1 to:select
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   547
            ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   548
        ]
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   549
    ]
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   550
18264
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   551
    "Modified: / 24-09-1997 / 16:34:52 / stefan"
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   552
    "Modified: / 09-04-1998 / 17:15:57 / cg"
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   553
    "Modified: / 09-07-2018 / 11:16:30 / Stefan Vogel"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   554
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   555
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   556
listOfRuntimeValuesToRemember
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   557
    " list of all aspects that will be remembered after closing a FileBrowserV2"
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   558
    
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   559
    ^ #( 
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   560
"/        #filterModel
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   561
        #enableFileHistory
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   562
        #fileHistory
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   563
        #currentSortOrder
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   564
        #sortBlockProperty 
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   565
       )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   566
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   567
321c1729db5b initial checkin
penk
parents:
diff changeset
   568
resetAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
   569
321c1729db5b initial checkin
penk
parents:
diff changeset
   570
    RuntimeAspects := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   571
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   572
    "
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   573
     self resetAspects
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   574
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   575
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   576
321c1729db5b initial checkin
penk
parents:
diff changeset
   577
runtimeAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
   578
321c1729db5b initial checkin
penk
parents:
diff changeset
   579
    RuntimeAspects isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   580
        RuntimeAspects := Dictionary new.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   581
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   582
    ^ RuntimeAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
   583
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   584
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   585
userPreferencesAspectList
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   586
    " list of all aspects that will be saved with save settings
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   587
      that aspects will be image consistent if the settings are saved in Launcher
11501
7f8a01b9b166 class definition
Claus Gittinger <cg@exept.de>
parents: 11494
diff changeset
   588
      don't forget to add a access methods in UserPreferences if you add a aspect here
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   589
    "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   590
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   591
    ^ Dictionary 
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   592
        withKeysAndValues:#(
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   593
           viewDirsInContentsBrowser   true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   594
           showDirectoryTree           true
11501
7f8a01b9b166 class definition
Claus Gittinger <cg@exept.de>
parents: 11494
diff changeset
   595
           showHiddenFiles             true
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   596
           viewDescription             false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   597
           viewDetails                 true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   598
           viewDirectoryDescription    false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   599
           viewFilesInDirectoryTree    false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   600
           viewGroup                   false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   601
           viewOwner                   false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   602
           viewPermissions             false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   603
           viewPreview                 false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   604
           viewSize                    true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   605
           viewSizeInKiloBytes         false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   606
           viewSizeInBytes             false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   607
           viewTime                    true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   608
           viewType                    false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   609
           openMultipleApplicationsForType false
7788
c391cddbd84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7763
diff changeset
   610
           filenameEntryFieldVisibleHolder   true
c391cddbd84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7763
diff changeset
   611
           toolBarVisibleHolder        true
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   612
           sortDirectoriesBeforeFiles  true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   613
           openAlwaysInTextEditor      false
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
   614
           alwaysUseSmalltalkTools     true
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   615
           sortCaseless                false
13011
fe61ebc8f857 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13000
diff changeset
   616
           "/ useCodeView2InTools         true   -- vanishes
14709
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
   617
           showDirectoriesOnTop        false 
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   618
      )
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   619
11501
7f8a01b9b166 class definition
Claus Gittinger <cg@exept.de>
parents: 11494
diff changeset
   620
    "Modified: / 11-05-2012 / 09:22:04 / cg"
14709
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
   621
    "Modified: / 12-08-2014 / 13:13:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   622
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   623
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   624
!AbstractFileBrowser class methodsFor:'drag & drop'!
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   625
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   626
doStartDrag:aDropSource in:aView
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   627
    "set the cursors before starting the drag & drop operation"
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   628
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   629
    |hdl|
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   630
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   631
    hdl := DragAndDropManager new.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   632
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   633
    hdl disabledCursor:self disabledCursorIcon.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   634
    hdl enabledCursor:self enabledCursorIcon.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   635
    hdl alienCursor:nil.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   636
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   637
    hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   638
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   639
    "Modified: / 23-07-2007 / 23:00:38 / cg"
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   640
! !
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   641
5398
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   642
!AbstractFileBrowser class methodsFor:'help specs'!
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   643
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   644
basicHelpSpec
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   645
    <resource: #help>
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   646
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   647
    ^ super helpSpec addPairsFrom:#(
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   648
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   649
#lockFileEncoding
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   650
'Do not guess the encoding from the file''s contents.'
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   651
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6099
diff changeset
   652
#closeTabButton
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   653
'Close this tab'
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6099
diff changeset
   654
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   655
#addTerminal
17182
5f178bffa275 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17119
diff changeset
   656
'Add a shell terminal page'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   657
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   658
#make
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   659
'Call the make command'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   660
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   661
#searchFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   662
'Search a file'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   663
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   664
#directoryUp
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   665
'Directory up'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   666
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   667
#directoryBack
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   668
'Directory back'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   669
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   670
#directoryForward
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   671
'Directory forward'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   672
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   673
#directoryHistory
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   674
'Directory'
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   675
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   676
#copyFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   677
'Copy the selected file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   678
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   679
#cutFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   680
'Cut the selected file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   681
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   682
#editFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   683
'Edit the selected file'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   684
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   685
#fileHome
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   686
'Goto home directory'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   687
8093
426a17ddceb6 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 8091
diff changeset
   688
#fileDesktop
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   689
'Goto desktop directory'
8093
426a17ddceb6 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 8091
diff changeset
   690
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   691
#fileGotoDefault
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   692
'Goto default directory (ST/X start directory)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   693
6454
649bdd4e5639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6434
diff changeset
   694
#fileGotoSmalltalkDirectory
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   695
'Goto Smalltalk directory (ST/X application)'
6454
649bdd4e5639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6434
diff changeset
   696
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
   697
#fileGotoDefaultDirectory
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   698
'Goto current directory'
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
   699
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   700
#pasteFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   701
'Paste file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   702
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   703
#deleteFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   704
'Delete the selected file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   705
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   706
#fileIn
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   707
'File in'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   708
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   709
#fileHistory
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   710
'File history'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   711
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   712
#fileGotoBookmark
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   713
'Goto bookmarked directory'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   714
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   715
#hideToolBar
13910
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   716
'Hide the toolbar (show again via "View"-menu)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   717
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   718
#hideFilenameEntryField
13910
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   719
'Hide filename & filter fields (show again via "View"-menu)'
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   720
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   721
#hideBookmarks
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   722
'Hide the bookmarks (show again via "View"-menu)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   723
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   724
#openChangeBrowser
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   725
'Open a Changebrowser on file'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   726
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   727
#showFileDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   728
'Show file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   729
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   730
#hideFileDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   731
'Hide file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   732
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   733
#toggleDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   734
'Show/hide file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   735
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   736
#viewDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   737
'Show/hide file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   738
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   739
#selectDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   740
'Select file details to be shown'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   741
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   742
#showDifferences
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   743
'Show differences between file and editor versions'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   744
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   745
#toggleHexDisplay
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   746
'Toggle between hexadecimal and textual representation'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   747
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   748
#findInBrowser
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   749
'Navigate the browser''s file list to the edited file'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   750
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   751
#saveFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   752
'Save the editor''s contents into the file'
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   753
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   754
#saveFileAs
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   755
'Save the editor''s contents into another file'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   756
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   757
#reloadFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   758
'Reload from the file'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   759
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   760
#print
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   761
'Send to the printer'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   762
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   763
).
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   764
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   765
    "
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   766
     self helpSpec
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   767
    "
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   768
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   769
    "Modified: / 06-10-2011 / 14:55:27 / cg"
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   770
!
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   771
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   772
helpSpec
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   773
    <resource: #programHelp>
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   774
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   775
    |spec hist resources|
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   776
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   777
    spec := self basicHelpSpec.
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   778
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   779
    "/ add help items for the history
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   780
    hist := self directoryHistory.
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   781
    hist notNil ifTrue:[
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   782
        resources := self classResources.
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   783
        hist canForward ifTrue:[
7879
9c64dea1b14a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 7869
diff changeset
   784
            spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ].
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   785
        ].
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   786
        hist canBackward ifTrue:[
7879
9c64dea1b14a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 7869
diff changeset
   787
            spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ].
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   788
        ].
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   789
    ].
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   790
    ^ spec.
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   791
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   792
    "
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   793
     self helpSpec
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   794
    "
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   795
7879
9c64dea1b14a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 7869
diff changeset
   796
    "Modified: / 03-11-2007 / 12:05:01 / cg"
5398
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   797
! !
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   798
8994
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   799
!AbstractFileBrowser class methodsFor:'image specs'!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   800
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   801
clearHistoryIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   802
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   803
17413
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   804
    ^ ToolbarIconLibrary deleteIcon
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   805
    "/ ^ Icon deleteIcon
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   806
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   807
    "Modified: / 15-02-2017 / 19:45:24 / cg"
8994
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   808
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   809
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   810
copyIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   811
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   812
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   813
    ^ ToolbarIconLibrary copyIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   814
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   815
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   816
cutIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   817
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   818
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   819
    ^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon"
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   820
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   821
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   822
deleteIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   823
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   824
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   825
    ^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   826
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   827
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   828
directoryUpIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   829
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   830
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   831
    ^ ToolbarIconLibrary directoryUpIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   832
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   833
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   834
disabledCursorIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   835
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   836
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   837
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   838
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   839
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   840
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   841
    "
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   842
     self disabledCursorIcon inspect
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   843
     ImageEditor openOnClass:self andSelector:#disabledCursorIcon
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   844
     Icon flushCachedIcons
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   845
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   846
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   847
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   848
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   849
    ^Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   850
        constantNamed:#'AbstractFileBrowser class disabledCursorIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   851
        ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   852
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   853
8 @@H@P@@A X@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   854
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A?
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   855
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   856
!
6337
76a3f145aaad code cleanup
Claus Gittinger <cg@exept.de>
parents: 6335
diff changeset
   857
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   858
enabledCursorIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   859
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   860
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   861
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   862
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   863
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   864
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   865
    "
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   866
     self enabledCursorIcon inspect
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   867
     ImageEditor openOnClass:self andSelector:#enabledCursorIcon
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   868
     Icon flushCachedIcons
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   869
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   870
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   871
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   872
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   873
    ^Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   874
        constantNamed:#'AbstractFileBrowser class enabledCursorIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   875
        ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   876
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   877
P@@@@T@@@@E@@@@AP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   878
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   879
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   880
!
6337
76a3f145aaad code cleanup
Claus Gittinger <cg@exept.de>
parents: 6335
diff changeset
   881
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   882
fileInIcon
321c1729db5b initial checkin
penk
parents:
diff changeset
   883
    <resource: #programImage>
321c1729db5b initial checkin
penk
parents:
diff changeset
   884
6116
acc7f6b44b4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6114
diff changeset
   885
    ^ ToolbarIconLibrary fileInIcon
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   886
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   887
6079
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   888
historyBackIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   889
    <resource: #programImage>
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   890
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   891
    ^ ToolbarIconLibrary historyBackIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   892
!
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   893
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   894
historyForwardIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   895
    <resource: #programImage>
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   896
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   897
    ^ ToolbarIconLibrary historyForwardIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   898
!
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   899
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   900
homeIcon
321c1729db5b initial checkin
penk
parents:
diff changeset
   901
    <resource: #programImage>
321c1729db5b initial checkin
penk
parents:
diff changeset
   902
6079
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   903
    ^ ToolbarIconLibrary homeIcon
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   904
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   905
6074
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   906
homeIcon2
6079
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   907
    <resource: #programImage>
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   908
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   909
    ^ ToolbarIconLibrary homeIcon2
6074
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   910
!
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   911
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   912
htmlReloadIcon
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   913
    <resource: #programImage>
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   914
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   915
    ^ ToolbarIconLibrary reload22x22Icon
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   916
!
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   917
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   918
leftDownIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   919
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   920
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   921
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   922
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   923
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   924
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   925
     self leftDownIcon inspect
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   926
     ImageEditor openOnClass:self andSelector:#leftDownIcon"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   927
    
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   928
    ^ Icon constantNamed:#'AbstractFileBrowser class leftDownIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   929
        ifAbsentPut:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   930
            (Depth2Image new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   931
                width:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   932
                height:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   933
                photometric:(#palette);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   934
                bitsPerSample:(#( 2 ));
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   935
                samplesPerPixel:(1);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   936
                bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   937
                            fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   938
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   939
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   940
UUUU@@@@@@@AUUUUUUUUUP@a');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   941
                colorMapFromArray:#[ 255 255 255 0 0 0 40 40 100 255 0 0 ];
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   942
                mask:((ImageMask new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   943
                            width:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   944
                            height:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   945
                            bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   946
                                        fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   947
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O?
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   948
?>@C??? @???8@O??>@@@@@@@@@@@@@a');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   949
                            yourself);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   950
                yourself
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   951
        ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   952
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   953
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   954
menuHistoryList9x20Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   955
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   956
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   957
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   958
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   959
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   960
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   961
     self menuHistoryList9x20Icon inspect
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   962
     ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   963
     Icon flushCachedIcons"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   964
    
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   965
    ^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   966
        ifAbsentPut:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   967
            (Depth1Image new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   968
                width:9;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   969
                height:20;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   970
                photometric:(#palette);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   971
                bitsPerSample:(#( 1 ));
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   972
                samplesPerPixel:(1);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   973
                bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   974
                            fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   975
                colorMapFromArray:#[ 255 255 255 0 0 0 ];
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   976
                mask:((ImageMask new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   977
                            width:9;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   978
                            height:20;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   979
                            bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   980
                                        fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   981
                            yourself);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   982
                yourself
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   983
        ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   984
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   985
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   986
menuHistoryListIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   987
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   988
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   989
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   990
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   991
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   992
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   993
     self menuHistoryListIcon inspect
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   994
     ImageEditor openOnClass:self andSelector:#menuHistoryListIcon"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   995
    
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   996
    ^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryListIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   997
        ifAbsentPut:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   998
            (Depth1Image new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   999
                width:12;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1000
                height:12;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1001
                photometric:(#palette);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1002
                bitsPerSample:(#( 1 ));
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1003
                samplesPerPixel:(1);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1004
                bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1005
                colorMapFromArray:#[ 255 255 255 0 0 0 ];
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1006
                mask:((ImageMask new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1007
                            width:12;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1008
                            height:12;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1009
                            bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1010
                            yourself);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1011
                yourself
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1012
        ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1013
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1014
6087
344513ffd6a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6083
diff changeset
  1015
newDirectoryIcon
6074
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
  1016
    <resource: #programImage>
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
  1017
6087
344513ffd6a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6083
diff changeset
  1018
    ^ ToolbarIconLibrary newDirectoryIcon
3923
2988fc3c88ab next stage
penk
parents: 3922
diff changeset
  1019
!
2988fc3c88ab next stage
penk
parents: 3922
diff changeset
  1020
6091
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1021
removeTabIcon
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1022
    <resource: #programImage>
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1023
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1024
    ^ ToolbarIconLibrary removeTabIcon
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1025
!
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1026
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1027
vt100Terminal
321c1729db5b initial checkin
penk
parents:
diff changeset
  1028
    <resource: #programImage>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1029
321c1729db5b initial checkin
penk
parents:
diff changeset
  1030
    ^ ToolbarIconLibrary shell20x20Icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  1031
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1032
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  1033
!AbstractFileBrowser class methodsFor:'interface specs'!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  1034
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1035
encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1036
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1037
     by the UIPainter of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1038
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1039
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1040
     the UIPainter may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1041
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1042
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1043
     UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1044
     AbstractFileBrowser new openInterface:#encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1045
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1046
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1047
    <resource: #canvas>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1048
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1049
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1050
    #(FullSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1051
       name: encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1052
       window: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1053
      (WindowSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1054
         label: 'File Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1055
         name: 'File Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1056
         min: (Point 10 10)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1057
         bounds: (Rectangle 0 0 379 590)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1058
       )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1059
       component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1060
      (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1061
         collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1062
          (LabelSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1063
             label: 'Select the External (File-) Encoding:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1064
             name: 'Label1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1065
             layout: (LayoutFrame 0 0 0 0 0 1 30 0)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1066
             translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1067
             adjust: left
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1068
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1069
          (DataSetSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1070
             name: 'Table1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1071
             layout: (LayoutFrame 0 0 30 0 0 1 -60 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1072
             model: selectedEncoding
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1073
             hasHorizontalScrollBar: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1074
             hasVerticalScrollBar: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1075
             dataList: encodingList
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1076
             has3Dseparators: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1077
             columns: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1078
            (Array
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1079
               
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1080
              (DataSetColumnSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1081
                 label: 'Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1082
                 labelButtonType: Button
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1083
                 height: heightOfFirstRow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1084
                 model: at:
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1085
                 canSelect: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1086
                 isResizeable: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1087
                 showRowSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1088
                 showColSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1089
               ) 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1090
              (DataSetColumnSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1091
                 label: 'Description'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1092
                 labelButtonType: Button
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1093
                 height: heightOfFirstRow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1094
                 model: at:
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1095
                 canSelect: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1096
                 isResizeable: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1097
                 showRowSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1098
                 showColSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1099
               )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1100
             )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1101
             doubleClickChannel: accept
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1102
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1103
          (CheckBoxSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1104
             label: 'Lock Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1105
             name: 'LockEncodingCheckBox'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1106
             layout: (LayoutFrame 3 0 -60 1 217 0 -30 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1107
             activeHelpKey: lockFileEncoding
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1108
             model: lockFileEncoding
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1109
             translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1110
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1111
          (HorizontalPanelViewSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1112
             name: 'ButtonPanel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1113
             layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1114
             horizontalLayout: fitSpace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1115
             verticalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1116
             horizontalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1117
             verticalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1118
             reverseOrderIfOKAtLeft: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1119
             component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1120
            (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1121
               collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1122
                (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1123
                   label: 'Cancel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1124
                   name: 'Button2'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1125
                   translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1126
                   model: cancel
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1127
                   extent: (Point 183 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1128
                 )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1129
                (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1130
                   label: 'OK'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1131
                   name: 'Button1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1132
                   translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1133
                   model: accept
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1134
                   isDefault: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1135
                   extent: (Point 184 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1136
                 )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1137
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1138
              
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1139
             )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1140
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1141
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1142
        
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1143
       )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1144
     )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1145
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1146
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1147
lineEndConventionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1148
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1149
     by the UIPainter of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1150
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1151
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1152
     the UIPainter may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1153
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1154
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1155
     UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1156
     AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1157
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1158
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1159
    <resource: #canvas>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1160
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1161
    ^ 
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1162
    #(FullSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1163
       name: lineEndConventionDialogSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1164
       window: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1165
      (WindowSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1166
         label: 'Line-End Convention'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1167
         name: 'Line-End Convention'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1168
         min: (Point 10 10)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1169
         bounds: (Rectangle 0 0 379 239)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1170
       )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1171
       component: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1172
      (SpecCollection
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1173
         collection: (
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1174
          (LabelSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1175
             label: 'Select the Line-End Convention (used when saving files):'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1176
             name: 'Label1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1177
             layout: (LayoutFrame 0 0 0 0 0 1 30 0)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1178
             translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1179
             adjust: left
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1180
           )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1181
          (VerticalPanelViewSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1182
             name: 'VerticalPanel1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1183
             layout: (LayoutFrame 20 0 40 0 0 1 -30 1)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1184
             horizontalLayout: fit
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1185
             verticalLayout: topSpace
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1186
             horizontalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1187
             verticalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1188
             component: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1189
            (SpecCollection
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1190
               collection: (
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1191
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1192
                   label: 'NL (Unix)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1193
                   name: 'RadioButton1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1194
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1195
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1196
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1197
                   select: nl
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1198
                   extent: (Point 359 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1199
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1200
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1201
                   label: 'CR-NL (MSDOS)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1202
                   name: 'RadioButton4'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1203
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1204
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1205
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1206
                   select: crlf
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1207
                   extent: (Point 359 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1208
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1209
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1210
                   label: 'CR (VMS and pre OSX mac)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1211
                   name: 'RadioButton5'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1212
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1213
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1214
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1215
                   select: cr
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1216
                   extent: (Point 359 22)
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1217
                 )
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1218
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1219
                   label: 'ETX (some modem protocols and mainframe files)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1220
                   name: 'RadioButton6'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1221
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1222
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1223
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1224
                   select: etx
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1225
                   extent: (Point 359 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1226
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1227
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1228
                   label: 'EOT (some modem protocols and mainframe files)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1229
                   name: 'RadioButton7'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1230
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1231
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1232
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1233
                   select: eot
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1234
                   extent: (Point 359 22)
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1235
                 )
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1236
                )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1237
              
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1238
             )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1239
           )
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1240
          (HorizontalPanelViewSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1241
             name: 'ButtonPanel'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1242
             layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1243
             horizontalLayout: fitSpace
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1244
             verticalLayout: center
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1245
             horizontalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1246
             verticalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1247
             reverseOrderIfOKAtLeft: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1248
             component: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1249
            (SpecCollection
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1250
               collection: (
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1251
                (ActionButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1252
                   label: 'Cancel'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1253
                   name: 'Button2'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1254
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1255
                   model: cancel
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1256
                   extent: (Point 185 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1257
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1258
                (ActionButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1259
                   label: 'OK'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1260
                   name: 'Button1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1261
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1262
                   model: accept
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1263
                   isDefault: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1264
                   extent: (Point 185 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1265
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1266
                )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1267
              
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1268
             )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1269
           )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1270
          )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1271
        
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1272
       )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1273
     )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1274
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1275
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1276
tabStopConversionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1277
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1278
     by the UIPainter of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1279
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1280
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1281
     the UIPainter may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1282
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1283
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1284
     UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1285
     AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1286
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1287
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1288
    <resource: #canvas>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1289
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1290
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1291
     #(FullSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1292
        name: 'tabStopConversionDialogSpec'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1293
        window: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1294
       (WindowSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1295
          label: 'Tab-Stop Conversion'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1296
          name: 'Tab-Stop Conversion'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1297
          min: (Point 10 10)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1298
          bounds: (Rectangle 0 0 379 239)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1299
        )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1300
        component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1301
       (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1302
          collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1303
           (LabelSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1304
              label: 'Select the Tab-Stop Conversion (used when saving files):'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1305
              name: 'Label1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1306
              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1307
              translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1308
              adjust: left
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1309
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1310
           (VerticalPanelViewSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1311
              name: 'VerticalPanel1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1312
              layout: (LayoutFrame 0 0 30 0 0 1 -30 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1313
              horizontalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1314
              verticalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1315
              horizontalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1316
              verticalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1317
              component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1318
             (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1319
                collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1320
                 (RadioButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1321
                    label: '4'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1322
                    name: 'RadioButton1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1323
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1324
                    model: tabStops
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1325
                    isTriggerOnDown: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1326
                    select: 4
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1327
                    extent: (Point 136 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1328
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1329
                 (RadioButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1330
                    label: '8'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1331
                    name: 'RadioButton4'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1332
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1333
                    model: tabStops
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1334
                    isTriggerOnDown: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1335
                    select: 8
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1336
                    extent: (Point 136 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1337
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1338
                 )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1339
               
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1340
              )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1341
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1342
           (HorizontalPanelViewSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1343
              name: 'ButtonPanel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1344
              layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1345
              horizontalLayout: fitSpace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1346
              verticalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1347
              horizontalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1348
              verticalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1349
              reverseOrderIfOKAtLeft: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1350
              component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1351
             (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1352
                collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1353
                 (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1354
                    label: 'Cancel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1355
                    name: 'Button2'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1356
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1357
                    model: cancel
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1358
                    extent: (Point 185 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1359
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1360
                 (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1361
                    label: 'OK'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1362
                    name: 'Button1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1363
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1364
                    model: accept
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1365
                    isDefault: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1366
                    extent: (Point 185 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1367
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1368
                 )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1369
               
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1370
              )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1371
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1372
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1373
         
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1374
        )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1375
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1376
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1377
    "Modified: / 28-02-2012 / 11:12:38 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1378
! !
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  1379
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1380
!AbstractFileBrowser class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1381
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1382
baseBookmarksMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1383
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1384
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1385
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1386
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1387
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1388
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1389
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1390
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1391
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1392
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1393
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1394
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1395
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1396
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1397
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1398
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1399
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1400
            enabled: currentFilesHasDirectories
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1401
            label: 'Add Bookmark'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1402
            itemValue: addBookmark
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1403
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1404
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1405
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1406
            enabled: hasBookmarksToRemove
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1407
            label: 'Remove Bookmark'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1408
            itemValue: removeBookmark
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1409
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1410
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1411
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1412
            label: 'Save Bookmarks In...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1413
            itemValue: saveBookmarks
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1414
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1415
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1416
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1417
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1418
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1419
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1420
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1421
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1422
baseBookmarksMenuSpec2
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1423
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1424
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1425
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1426
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1427
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1428
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1429
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1430
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1431
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1432
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1433
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1434
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1435
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1436
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1437
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1438
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1439
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1440
            label: 'Edit Bookmarks'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1441
            itemValue: editBookmarks
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1442
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1443
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1444
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1445
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1446
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1447
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1448
            enabled: currentFilesHasDirectories
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1449
            label: 'Add Bookmark'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1450
            itemValue: addBookmark
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1451
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1452
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1453
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1454
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1455
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1456
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1457
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1458
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1459
browserMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1460
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1461
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1462
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1463
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1464
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1465
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1466
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1467
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1468
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1469
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1470
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1471
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1472
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1473
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1474
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1475
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1476
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1477
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1478
            label: 'Spawn Filebrowser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1479
            itemValue: doSpawn
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1480
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1481
            shortcutKey: Ctrln
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1482
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1483
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1484
            label: 'Windows Explorer'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1485
            itemValue: doOpenExplorer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1486
            translateLabel: true
17946
8ecca5e905bd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17923
diff changeset
  1487
            isVisible: systemIsDOS
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1488
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1489
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1490
            label: 'Open Finder'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1491
            itemValue: doOpenFinder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1492
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1493
            isVisible: systemIsOSX
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1494
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1495
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1496
            label: 'C Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1497
            itemValue: doOpenCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1498
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1499
            isVisible: cBrowserMenuItemVisible
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1500
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1501
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1502
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1503
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1504
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1505
            label: 'Add Text Editor Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1506
            itemValue: newTextEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1507
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1508
            shortcutKey: Ctrlt
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1509
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1510
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1511
            label: 'Add Shell Terminal Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1512
            itemValue: doAddTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1513
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1514
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1515
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1516
            label: 'Add Archiver Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1517
            itemValue: doAddArchiver
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1518
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1519
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1520
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1521
            label: 'Add Search Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1522
            itemValue: doOpenSearchFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1523
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1524
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1525
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1526
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1527
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1528
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1529
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1530
            label: 'Settings...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1531
            itemValue: doOpenSettings
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1532
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1533
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1534
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1535
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1536
            label: 'Encoding...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1537
            itemValue: fileEncodingDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1538
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1539
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1540
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1541
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1542
            label: 'Line End Convention...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1543
            itemValue: lineEndConventionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1544
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1545
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1546
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1547
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1548
            label: 'Tab Stop Conversion...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1549
            itemValue: tabStopConversionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1550
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1551
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1552
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1553
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1554
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1555
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1556
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1557
            label: 'Exit'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1558
            itemValue: closeRequest
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1559
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1560
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1561
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1562
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1563
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1564
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1565
17724
87f3d255c4e7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17715
diff changeset
  1566
    "Modified: / 29-10-2017 / 11:13:49 / cg"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1567
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1568
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1569
directoryMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1570
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1571
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1572
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1573
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1574
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1575
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1576
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1577
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1578
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1579
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1580
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1581
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1582
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1583
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1584
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1585
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1586
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1587
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1588
            label: 'Bookmarks'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1589
            submenuChannel: bookmarksMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1590
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1591
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1592
            label: 'Visited Directories'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1593
            submenuChannel: visitedDirectoriesMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1594
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1595
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1596
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1597
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1598
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1599
            label: 'Up'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1600
            itemValue: doGoDirectoryUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1601
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1602
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1603
            activeHelpKey: directoryBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1604
            enabled: enableBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1605
            label: 'Back'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1606
            itemValue: doBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1607
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1608
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1609
            activeHelpKey: directoryBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1610
            enabled: enableForward
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1611
            label: 'Forward'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1612
            itemValue: doForward
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1613
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1614
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1615
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1616
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1617
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1618
            enabled: enableHome
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1619
            label: 'Home Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1620
            itemValue: doGotoHomeDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1621
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1622
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1623
            enabled: enableGotoDesktopDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1624
            label: 'Desktop'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1625
            itemValue: doGotoDesktopDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1626
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1627
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1628
            enabled: enableGotoDefaultDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1629
            label: 'Default (Current) Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1630
            itemValue: doGotoDefaultDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1631
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1632
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1633
            enabled: enableGotoSmalltalkDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1634
            label: 'Smalltalk (Application) Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1635
            itemValue: doGotoSmalltalkDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1636
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1637
         (MenuItem
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1638
            enabled: enableGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1639
            label: 'Smalltalk Workspace Directory'
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1640
            itemValue: doGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1641
          )
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1642
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1643
            enabled: enableGotoTempDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1644
            label: 'Smalltalk Temp Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1645
            itemValue: doGotoTempDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1646
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1647
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1648
            label: '-'
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1649
            isVisible: false
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1650
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1651
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1652
            enabled: enableMakeCurrentDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1653
            label: 'Make this the Default (Current) Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1654
            itemValue: doMakeCurrentDirectory
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1655
            isVisible: false
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1656
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1657
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1658
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1659
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1660
      )
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1661
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1662
    "Modified: / 17-07-2017 / 10:08:31 / cg"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1663
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1664
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1665
editMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1666
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1667
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1668
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1669
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1670
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1671
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1672
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1673
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1674
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1675
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1676
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1677
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1678
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1679
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1680
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1681
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1682
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1683
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1684
            label: 'Copy Selected Filenames to Clipboard'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1685
            itemValue: copySelectedFilenames
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1686
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1687
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1688
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1689
            enabled: fileListIsNotEmpty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1690
            label: 'Copy all Filenames to Clipboard'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1691
            itemValue: copyFileList
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1692
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1693
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1694
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1695
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1696
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1697
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1698
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1699
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1700
emptyMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1701
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1702
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1703
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1704
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1705
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1706
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1707
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1708
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1709
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1710
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1711
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1712
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1713
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1714
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1715
     #(#Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1716
        #(
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1717
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1718
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1719
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1720
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1721
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1722
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1723
extraMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1724
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1725
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1726
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1727
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1728
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1729
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1730
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1731
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1732
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1733
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1734
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1735
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1736
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1737
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1738
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1739
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1740
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1741
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1742
            label: 'Encoding...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1743
            itemValue: fileEncodingDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1744
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1745
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1746
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1747
            label: 'Line End Convention...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1748
            itemValue: lineEndConventionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1749
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1750
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1751
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1752
            label: 'Tab Stop Conversion...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1753
            itemValue: tabStopConversionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1754
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1755
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1756
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1757
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1758
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1759
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1760
            label: 'Settings...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1761
            itemValue: doOpenSettings
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1762
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1763
            labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...')
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1764
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1765
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1766
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1767
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1768
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1769
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1770
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1771
fileMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1772
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1773
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1774
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1775
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1776
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1777
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1778
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1779
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1780
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1781
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1782
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1783
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1784
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1785
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1786
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1787
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1788
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1789
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1790
            enabled: enableFileHistory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1791
            label: 'File History'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1792
            submenuChannel: menuFileHistory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1793
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1794
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1795
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1796
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1797
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1798
            label: 'Open'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1799
            itemValue: doShowFileContents
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1800
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1801
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1802
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1803
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1804
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1805
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1806
            label: 'FileIn'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1807
            itemValue: fileFileIn
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1808
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1809
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1810
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1811
            label: 'FileIn to Namespace...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1812
            itemValue: fileFileInToNameSpace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1813
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1814
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1815
            enabled: hasPackageDirectorySelected
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1816
            label: 'Load Package from Here'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1817
            itemValue: fileFileInPackage
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1818
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1819
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1820
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1821
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1822
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1823
            label: 'New'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1824
            submenuChannel: newMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1825
            keepLinkedMenu: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1826
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1827
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1828
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1829
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1830
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1831
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1832
            label: 'Cut'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1833
            itemValue: cutFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1834
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1835
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1836
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1837
            label: 'Copy'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1838
            itemValue: copyFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1839
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1840
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1841
            enabled: canPaste
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1842
            label: 'Paste'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1843
            itemValue: pasteFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1844
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1845
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1846
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1847
            label: 'Delete'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1848
            itemValue: deleteFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1849
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1850
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1851
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1852
            label: 'Erase'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1853
            itemValue: eraseFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1854
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1855
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1856
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1857
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1858
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1859
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1860
            label: 'Rename...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1861
            itemValue: renameSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1862
            shortcutKey: Rename
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1863
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1864
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1865
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1866
            label: 'Move To...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1867
            itemValue: moveSelectionTo
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1868
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1869
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1870
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1871
            label: 'Copy To...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1872
            itemValue: copySelectionTo
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1873
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1874
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1875
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1876
            label: 'Properties...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1877
            itemValue: doShowProperties
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1878
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1879
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1880
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1881
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1882
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1883
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1884
            enabled: canAddToClassPath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1885
            label: 'Add to Java Class Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1886
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1887
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1888
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1889
            enabled: canRemoveFromClassPath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1890
            label: 'Remove from Java Class Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1891
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1892
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1893
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1894
            enabled: canAddToSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1895
            label: 'Add to Java Source Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1896
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1897
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1898
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1899
            enabled: canRemoveFromSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1900
            label: 'Remove from Java Source Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1901
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1902
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1903
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1904
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1905
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1906
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1907
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1908
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1909
fileOpMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1910
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1911
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1912
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1913
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1914
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1915
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1916
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1917
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1918
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1919
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1920
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1921
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1922
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1923
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1924
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1925
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1926
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1927
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1928
            enabled: hasFileSelection
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1929
            label: 'Split (by size)...'
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1930
            itemValue: splitSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1931
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1932
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1933
            enabled: hasFileSelection
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1934
            label: 'Split (by #lines)...'
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1935
            itemValue: splitSelectedFilesByLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1936
          )
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1937
         (MenuItem
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1938
            enabled: hasFileSelection
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1939
            label: 'Join...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1940
            itemValue: joinSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1941
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1942
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1943
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1944
            label: 'Copy Corrupted File To...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1945
            itemValue: copySelectionToRepairingCorruptedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1946
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1947
         (MenuItem
15569
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1948
            label: 'Copy Corrupted File From -> To...'
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1949
            itemValue: copyFromToRepairingCorruptedFiles
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1950
          )
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1951
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1952
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1953
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1954
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1955
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1956
            label: 'Rot13...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1957
            itemValue: filterSelectedFiles:
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1958
            argument: rot13
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1959
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1960
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1961
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1962
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1963
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1964
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1965
            label: 'Truncate...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1966
            itemValue: truncateSelectedFilesToZeroSize
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1967
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1968
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1969
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1970
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1971
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1972
            label: 'Load Signature Support Package'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1973
            itemValue: loadSignatureSupport
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1974
            isVisible: cannotGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1975
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1976
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1977
            enabled: canGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1978
            label: 'Generate Signed Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1979
            itemValue: generateSignaturesForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1980
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1981
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1982
            enabled: canGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1983
            label: 'Generate Detached Signature Files (use for dll)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1984
            itemValue: generateDetachedSignaturesForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1985
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1986
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1987
            enabled: canGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1988
            label: 'Generate Patch Installer for File(s)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1989
            itemValue: generatePatchInstallerForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1990
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1991
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1992
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1993
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1994
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1995
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1996
            label: 'File Differences'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1997
            itemValue: openDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1998
            isVisible: hasTwoFilesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1999
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2000
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2001
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2002
            label: 'File Differences...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2003
            itemValue: openDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2004
            isVisible: hasNotTwoFilesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2005
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2006
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2007
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2008
            label: 'Directory Differences'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2009
            itemValue: openDirectoryDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2010
            isVisible: hasTwoDirectoriesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2011
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2012
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2013
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2014
            label: 'Directory Differences...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2015
            itemValue: openDirectoryDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2016
            isVisible: hasNotTwoDirectoriesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2017
          )
17831
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2018
         (MenuItem
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2019
            label: '-'
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2020
          )
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2021
         (MenuItem
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2022
            label: 'Remove .bak and .sav Files...'
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2023
            itemValue: removeBakAndSavFiles
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2024
          )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2025
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2026
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2027
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2028
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2029
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2030
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2031
newMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2032
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2033
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2034
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2035
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2036
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2037
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2038
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2039
     MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2040
     (Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2041
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2042
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2043
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2044
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2045
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2046
     #(#Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2047
        #(
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2048
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2049
            #label: 'Directory...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2050
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2051
            #value: #newDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2052
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2053
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2054
            #label: 'File...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2055
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2056
            #value: #newFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2057
          )                                     
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2058
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2059
            #label: 'Hard Link...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2060
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2061
            #value: #newHardLink
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2062
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2063
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2064
            #label: 'Symbolic Link...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2065
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2066
            #value: #newSoftLink
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2067
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2068
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2069
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2070
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2071
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2072
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2073
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2074
scmMenuSlice
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2075
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2076
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2077
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2078
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2079
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2080
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2081
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2082
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2083
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#scmMenuSlice
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2084
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser scmMenuSlice)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2085
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2086
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2087
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2088
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2089
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2090
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2091
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2092
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2093
            label: 'CVS'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2094
            isVisible: cvsMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2095
            submenuChannel: cvsMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2096
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2097
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2098
            label: 'SVN'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2099
            isVisible: svnMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2100
            submenuChannel: svnMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2101
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2102
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2103
            label: 'Mercurial'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2104
            isVisible: mercurialMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2105
            submenuChannel: mercurialMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2106
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2107
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2108
            label: 'HG'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2109
            isVisible: hgMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2110
            submenuChannel: hgMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2111
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2112
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2113
            label: 'Perforce'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2114
            isVisible: perforceMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2115
            submenuChannel: perforceMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2116
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2117
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2118
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2119
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2120
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2121
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2122
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2123
showMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2124
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2125
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2126
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2127
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2128
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2129
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2130
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2131
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2132
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2133
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2134
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2135
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2136
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2137
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2138
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2139
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2140
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2141
            label: 'Hidden Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2142
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2143
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2144
            indication: showHiddenFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2145
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2146
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2147
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2148
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2149
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2150
            label: 'Directory Tree'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2151
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2152
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2153
            indication: showDirectoryTree
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2154
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2155
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2156
            label: 'Regular Files in TreeView (Left)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2157
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2158
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2159
            indication: viewFilesInDirectoryTree
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2160
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2161
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2162
            label: 'Directories in ContentsView (Right)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2163
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2164
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2165
            indication: viewDirsInContentsBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2166
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2167
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2168
            enabled: enableViewNoteBookApplication
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2169
            label: 'File Applications'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2170
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2171
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2172
            indication: viewNoteBookApplicationHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2173
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2174
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2175
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2176
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2177
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2178
            label: 'DiskUsage'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2179
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2180
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2181
            indication: showDiskUsageHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2182
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2183
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2184
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2185
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2186
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2187
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2188
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2189
showMenuSpecForDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2190
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2191
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2192
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2193
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2194
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2195
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2196
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2197
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2198
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2199
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2200
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2201
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2202
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2203
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2204
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2205
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2206
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2207
            label: 'Hidden Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2208
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2209
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2210
            indication: showHiddenFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2211
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2212
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2213
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2214
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2215
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2216
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2217
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2218
sortMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2219
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2220
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2221
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2222
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2223
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2224
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2225
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2226
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2227
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2228
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2229
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2230
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2231
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2232
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2233
     #(#Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2234
        #(
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2235
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2236
            #label: 'By Filename'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2237
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2238
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2239
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2240
            #choiceValue: #baseName
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2241
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2242
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2243
            #label: 'By Extension'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2244
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2245
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2246
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2247
            #choiceValue: #suffix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2248
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2249
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2250
            #label: 'By Permissions'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2251
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2252
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2253
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2254
            #choiceValue: #permissions
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2255
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2256
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2257
            #label: 'By Owner'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2258
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2259
            #isVisible: #viewOwner
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2260
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2261
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2262
            #choiceValue: #owner
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2263
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2264
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2265
            #label: 'By Group'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2266
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2267
            #isVisible: #viewOwner
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2268
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2269
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2270
            #choiceValue: #group
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2271
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2272
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2273
            #label: 'By Size'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2274
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2275
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2276
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2277
            #choiceValue: #fileSize
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2278
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2279
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2280
            #label: 'By Date && Time'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2281
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2282
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2283
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2284
            #choiceValue: #modificationTime
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2285
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2286
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2287
            #label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2288
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2289
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2290
            #label: 'Ignore Case in Sort'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2291
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2292
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2293
            #indication: #sortCaseless
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2294
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2295
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2296
            #label: 'Directories before Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2297
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2298
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2299
            #indication: #sortDirectoriesBeforeFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2300
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2301
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2302
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2303
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2304
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2305
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2306
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2307
toolsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2308
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2309
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2310
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2311
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2312
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2313
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2314
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2315
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2316
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2317
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2318
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2319
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2320
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2321
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2322
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2323
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2324
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2325
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2326
            label: 'Open (Win32-Shell)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2327
            itemValue: doOpenWithShellCommand
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2328
            isVisible: systemIsDOS
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2329
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2330
         (MenuItem
18013
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2331
            label: 'Open (OSX-Application)'
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2332
            itemValue: doOpenWithShellCommand
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2333
            isVisible: systemIsOSX
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2334
          )
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2335
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2336
            label: 'Execute UNIX Command...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2337
            itemValue: doExecuteCommand
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2338
            isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2339
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2340
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2341
            label: 'Execute DOS Command...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2342
            itemValue: doExecuteCommand
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2343
            isVisible: systemIsDOS
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2344
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2345
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2346
            label: 'Execute Script...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2347
            itemValue: doExecuteScript
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2348
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2349
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2350
            enabled: canDoTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2351
            label: 'Shell Terminal'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2352
            itemValue: openTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2353
            isVisible: canDoTerminalAndSystemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2354
            labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal')
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2355
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2356
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2357
            enabled: canDoTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2358
            label: 'DOS Terminal'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2359
            itemValue: openTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2360
            isVisible: canDoTerminalAndSystemIsDOS
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2361
            labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal')
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2362
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2363
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2364
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2365
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2366
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2367
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2368
            label: 'Changes Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2369
            itemValue: openChangesBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2370
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2371
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2372
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2373
            label: 'ChangeSet Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2374
            itemValue: openChangeSetBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2375
            isVisible: changeSetBrowserItemVisible
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2376
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2377
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2378
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2379
            label: 'Workspace'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2380
            itemValue: openWorkspace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2381
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2382
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2383
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2384
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2385
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2386
            enabled: canReadAbbrevFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2387
            label: 'Install Autoloaded'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2388
            itemValue: readAbbrevFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2389
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2390
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2391
            enabled: anySTFilesPresent
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2392
            label: 'Install all ST-Files as Autoloaded'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2393
            itemValue: installAllAsAutoloaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2394
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2395
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2396
            enabled: recursiveAnySTFilesPresent
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2397
            label: 'Recursive Install all ST-Files as Autoloaded'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2398
            itemValue: installAllAsAutoloadedRecursive
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2399
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2400
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2401
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2402
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2403
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2404
            enabled: hasJava
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2405
            label: 'Add Directory to Java Source Path (stx:libjava)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2406
            itemValue: addDirToJavaSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2407
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2408
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2409
            enabled: hasJava
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2410
            label: 'Add Selected Files to Java Source Path (stx:libjava)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2411
            itemValue: fileAddToJavaSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2412
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2413
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2414
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2415
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2416
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2417
            label: 'File Operations'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2418
            submenuChannel: fileOpMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2419
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2420
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2421
            label: 'File Utilities'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2422
            submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2423
           (Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2424
              (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2425
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2426
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2427
                  label: 'Editor'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2428
                  itemValue: openEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2429
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2430
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2431
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2432
                  label: 'HTML Reader'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2433
                  itemValue: openHTMLReader
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2434
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2435
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2436
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2437
                  label: 'Web Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2438
                  itemValue: openWebBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2439
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2440
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2441
                  label: 'XML Inspector'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2442
                  itemValue: inspectXmlFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2443
                  isVisible: hasXml
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2444
                  showBusyCursorWhilePerforming: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2445
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2446
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2447
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2448
                  label: 'Acroread (PDF Viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2449
                  itemValue: openPDFViewer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2450
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2451
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2452
                  enabled: hasASN1AndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2453
                  label: 'ASN1 Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2454
                  itemValue: openASN1Browser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2455
                  isVisible: hasASN1
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2456
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2457
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2458
                  enabled: hasCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2459
                  label: 'C Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2460
                  itemValue: openCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2461
                  isVisible: hasCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2462
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2463
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2464
                  enabled: canOpenMonticelloBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2465
                  label: 'Monticello Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2466
                  itemValue: doOpenMonticelloBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2467
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2468
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2469
                  enabled: hasJavaAndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2470
                  label: 'Applet Viewer'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2471
                  itemValue: openAppletViewer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2472
                  isVisible: hasJava
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2473
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2474
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2475
                  enabled: hasMP3PlayerAndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2476
                  label: 'MP3 Player'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2477
                  itemValue: openMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2478
                  isVisible: hasMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2479
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2480
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2481
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2482
                  label: 'xv (Image Viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2483
                  itemValue: openXV
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2484
                  isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2485
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2486
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2487
                  enabled: currentFilesAreInSameDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2488
                  label: 'Slide Show'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2489
                  itemValue: openSlideShow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2490
                  isVisible: hasSlideShow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2491
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2492
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2493
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2494
                  label: 'gv (Postscript Viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2495
                  itemValue: openGV
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2496
                  isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2497
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2498
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2499
                  enabled: hasMP3PlayerAndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2500
                  label: 'MP3 Player'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2501
                  itemValue: openMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2502
                  isVisible: hasMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2503
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2504
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2505
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2506
                  label: 'Realplay (avi viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2507
                  itemValue: openRP
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2508
                  isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2509
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2510
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2511
                  label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2512
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2513
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2514
                  label: 'Smalltalk'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2515
                  submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2516
                 (Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2517
                    (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2518
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2519
                        enabled: hasSnapshotSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2520
                        label: 'Snapshot Image Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2521
                        itemValue: openSnapshotImageBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2522
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2523
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2524
                        enabled: canCreateNewProject
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2525
                        label: 'Create Smalltalk Project'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2526
                        itemValue: createProjectAndOpenProjectBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2527
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2528
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2529
                        label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2530
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2531
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2532
                        enabled: hasResourceFileSelected
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2533
                        label: 'Show Contents of Resourcefile'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2534
                        itemValue: readAndShowResources
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2535
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2536
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2537
                        enabled: hasResourceFileSelected
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2538
                        label: 'Resource File Editor'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2539
                        itemValue: openResourceFileEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2540
                        showBusyCursorWhilePerforming: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2541
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2542
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2543
                        label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2544
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2545
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2546
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2547
                        label: 'Contents as ByteArray'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2548
                        itemValue: fileContentsAsByteArray
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2549
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2550
                     )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2551
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2552
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2553
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2554
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2555
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2556
                  label: 'Image'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2557
                  submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2558
                 (Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2559
                    (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2560
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2561
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2562
                        label: 'Image Editor'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2563
                        itemValue: openImageEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2564
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2565
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2566
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2567
                        label: 'Image Preview'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2568
                        itemValue: openImagePreview
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2569
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2570
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2571
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2572
                        label: 'Image Inspector'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2573
                        itemValue: openImageInspector
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2574
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2575
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2576
                        label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2577
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2578
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2579
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2580
                        label: 'Convert to GIF'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2581
                        itemValue: convertImageToGIF
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2582
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2583
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2584
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2585
                        label: 'Convert to PNG'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2586
                        itemValue: convertImageToPNG
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2587
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2588
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2589
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2590
                        label: 'Convert to XPM'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2591
                        itemValue: convertImageToXPM
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2592
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2593
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2594
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2595
                        label: 'Convert to JPG'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2596
                        itemValue: convertImageToJPG
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2597
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2598
                     )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2599
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2600
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2601
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2602
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2603
               (MenuItem
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2604
                  label: 'Web'
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2605
                  submenu: 
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2606
                 (Menu
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2607
                    (
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2608
                     (MenuItem
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2609
                        label: 'Fetch File by URL...'
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2610
                        itemValue: fetchFileByURL
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2611
                      )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2612
                     )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2613
                    nil
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2614
                    nil
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2615
                  )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2616
                )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2617
               (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2618
                  enabled: hasZipFileSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2619
                  label: 'ZipFile Tool'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2620
                  itemValue: openZipTool
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2621
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2622
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2623
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2624
                  label: 'Hex Dump'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2625
                  itemValue: fileHexDump
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2626
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2627
               )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2628
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2629
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2630
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2631
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2632
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2633
            label: 'Find'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2634
            submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2635
           (Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2636
              (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2637
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2638
                  label: 'File...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2639
                  itemValue: fileFindFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2640
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2641
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2642
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2643
                  label: 'Same Contents as Selected...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2644
                  itemValue: fileFindDuplicateFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2645
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2646
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2647
                  label: 'Duplicate Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2648
                  itemValue: fileFindDuplicates
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2649
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2650
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2651
                  enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2652
                  label: 'All Duplicate Files (Recursive)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2653
                  itemValue: fileFindAllDuplicates
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2654
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2655
               (MenuItem
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2656
                  label: 'Similar Image Files (by Colors)'
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2657
                  itemValue: fileFindSimilarImages
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2658
                  isVisible: hasImageColorHistogram
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2659
                )
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2660
               (MenuItem
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2661
                  label: 'Similar Image Files (by Form)'
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2662
                  itemValue: fileFindSimilarImagesByForm
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2663
                  isVisible: hasImageHistogram
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2664
                )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2665
               )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2666
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2667
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2668
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2669
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2670
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2671
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2672
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2673
      )
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2674
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2675
    "Modified: / 10-09-2017 / 16:50:09 / cg"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2676
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2677
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2678
viewDetailsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2679
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2680
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2681
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2682
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2683
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2684
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2685
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2686
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2687
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2688
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2689
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2690
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2691
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2692
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2693
     #(#Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2694
        #(
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2695
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2696
            #label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2697
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2698
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2699
            #label: 'Hidden Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2700
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2701
            #indication: #showHiddenFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2702
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2703
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2704
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2705
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2706
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2707
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2708
11144
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  2709
!AbstractFileBrowser class methodsFor:'menu specs-scm'!
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  2710
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2711
cvsMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2712
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2713
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2714
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2715
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2716
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2717
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2718
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2719
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2720
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2721
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2722
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2723
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2724
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2725
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2726
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2727
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2728
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2729
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2730
            label: 'Commit (CVS)...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2731
            itemValue: cvsCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2732
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2733
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2734
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2735
            enabled: canCvsAddAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2736
            label: 'Add && Commit...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2737
            itemValue: cvsAddAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2738
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2739
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2740
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2741
            enabled: canCvsAddAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2742
            label: 'Add as Binary && Commit...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2743
            itemValue: cvsAddBinaryAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2744
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2745
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2746
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2747
            label: 'Commit Folder (CVS)...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2748
            itemValue: cvsCommitFolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2749
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2750
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2751
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2752
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2753
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2754
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2755
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2756
            label: 'Update selected Files/Directories'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2757
            itemValue: cvsUpdateSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2758
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2759
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2760
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2761
            label: 'Update Directory Local'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2762
            itemValue: cvsUpdateAll
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2763
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2764
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2765
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2766
            label: 'Update Directory Recursive'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2767
            itemValue: cvsUpdateAllRecursive
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2768
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2769
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2770
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2771
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2772
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2773
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2774
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2775
            label: 'Tag...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2776
            itemValue: cvsTagSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2777
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2778
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2779
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2780
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2781
            label: 'Revision Log'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2782
            itemValue: cvsRevisionLog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2783
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2784
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2785
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2786
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2787
            label: 'Compare with newest in Repository'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2788
            itemValue: cvsCompareWithNewest
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2789
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2790
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2791
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2792
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2793
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2794
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2795
            enabled: canRemoveCVSContainer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2796
            label: 'Remove File && CVS Container...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2797
            itemValue: cvsRemoveFileAndCVSContainer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2798
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2799
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2800
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2801
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2802
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2803
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2804
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2805
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2806
mercurialMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2807
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2808
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2809
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2810
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2811
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2812
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2813
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2814
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2815
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2816
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2817
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2818
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2819
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2820
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2821
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2822
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2823
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2824
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2825
            label: 'Add'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2826
            itemValue: mercurialAdd
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2827
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2828
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2829
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2830
            label: 'Commit Changes'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2831
            itemValue: mercurialCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2832
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2833
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2834
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2835
            label: 'Push...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2836
            itemValue: mercurialPush
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2837
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2838
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2839
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2840
            label: 'Status'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2841
            itemValue: mercurialStatus
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2842
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2843
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2844
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2845
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2846
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2847
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2848
            label: 'Init'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2849
            itemValue: mercurialInit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2850
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2851
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2852
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2853
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2854
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2855
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2856
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2857
    "Modified: / 17-01-2012 / 15:57:40 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2858
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2859
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2860
perforceMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2861
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2862
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2863
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2864
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2865
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2866
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2867
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2868
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2869
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2870
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2871
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2872
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2873
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2874
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2875
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2876
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2877
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2878
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2879
            label: 'Commit'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2880
            itemValue: perforceCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2881
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2882
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2883
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2884
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2885
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2886
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2887
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2888
    "Created: / 15-01-2012 / 13:12:30 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2889
! !
11144
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  2890
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2891
!AbstractFileBrowser class methodsFor:'misc'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2893
newLock
321c1729db5b initial checkin
penk
parents:
diff changeset
  2894
    ^ CodeExecutionLock new
321c1729db5b initial checkin
penk
parents:
diff changeset
  2895
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2896
17288
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2897
!AbstractFileBrowser class methodsFor:'queries'!
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2898
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2899
isAbstract
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2900
    ^ self == AbstractFileBrowser
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2901
! !
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2902
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2903
!AbstractFileBrowser class methodsFor:'queries-file'!
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2904
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2905
getBestDirectoryFrom:directories
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2906
    "from a set of directories, return the common parent directory"
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2907
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2908
    |stringCol firstPre|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2909
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2910
    directories isEmpty ifTrue:[^ nil].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2911
    directories size == 1 ifTrue:[^ directories first].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2912
    stringCol := (directories collect:[:file| file asString]) asOrderedCollection.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2913
    firstPre := stringCol at:1.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2914
    stringCol from:2 do:[:el|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2915
         firstPre :=  firstPre commonPrefixWith:el.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2916
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2917
    (firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2918
        firstPre removeLast.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2919
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2920
    ^ firstPre asFilename
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2921
! !
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2922
5644
e24749db1f5f share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents: 5634
diff changeset
  2923
!AbstractFileBrowser class methodsFor:'resources'!
e24749db1f5f share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents: 5634
diff changeset
  2924
e24749db1f5f share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents: 5634
diff changeset
  2925
classResources
e24749db1f5f share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents: 5634
diff changeset
  2926
    ^ FileBrowser classResources
e24749db1f5f share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents: 5634
diff changeset
  2927
! !
e24749db1f5f share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents: 5634
diff changeset
  2928
17746
7b5d6fc64fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17744
diff changeset
  2929
!AbstractFileBrowser class methodsFor:'utilities - dump'!
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  2930
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2931
contentsOfBytesAsDump:data base:numberBase numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2932
    "utility helper: generate a hexDump with addresses;
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2933
     characterEncodingSymbol determines how characters are to be shown in the right (character) columns.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2934
     By default, this is iso8859-1, but supported are also ebcdic and ascii7,
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2935
     to support display of alien encoded binary data."
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2936
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2937
    |lines nHexLines replacementForUnprintable colsPerByte characterDecoder|
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2938
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2939
    (characterEncodingSymbol isNil or:[characterEncodingSymbol == #'iso8859-1']) ifFalse:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2940
        characterDecoder := CharacterEncoder encoderToEncodeFrom:characterEncodingSymbol into:#unicode.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2941
    ].    
17252
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2942
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2943
    "/ used to be:
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2944
    "/ replacementForUnprintable := $.
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2945
    replacementForUnprintable := Character value:16rB7. "/ a centered dot.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2946
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2947
    "/ cols needed per byte in the hex dump
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2948
    colsPerByte := ((255 printStringRadix:numberBase) size).
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2949
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2950
    "generate a virtual collection which evaluates and returns lines on-demand"
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2951
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2952
    nHexLines := (data size + 15) // 16.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2953
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2954
    lines := VirtualArray new.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2955
    lines setSize:nHexLines + (nHexLines // 16).
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2956
    lines 
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2957
        generator:[:lineNr |
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2958
            |blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2959
             decodedChar charPrinted|
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2960
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2961
            blockNr := (lineNr - 1) // 17.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2962
            lineNrInBlock := (lineNr - 1) \\ 17.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2963
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2964
            lineNrInBlock == 16 ifTrue:[
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2965
                line := ''
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2966
            ] ifFalse:[
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2967
                startOffset := ((blockNr * 16) + lineNrInBlock) * 16.
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2968
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2969
                "/ two streams; one for the hex bytes, one for the ascii-interpretation
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2970
                lineStream := String writeStream.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2971
                asciiLineStream := String writeStream.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2972
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2973
                lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits).
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2974
                lineStream nextPutAll:': '.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2975
                1 to:16 do:[:i |
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2976
                    i ~~ 1 ifTrue:[ lineStream space ].
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2977
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2978
                    (startOffset + i) > data size ifTrue:[
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2979
                        asciiLineStream nextPut:(Character space).
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2980
                        lineStream spaces:colsPerByte.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2981
                    ] ifFalse:[
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2982
                        byte := data at:startOffset + i.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2983
17746
7b5d6fc64fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17744
diff changeset
  2984
                        lineStream nextPutAll:(byte printStringRadix:numberBase size:colsPerByte fill:$0).
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2985
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2986
                        
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2987
                        decodedChar := byte.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2988
                        characterDecoder notNil ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2989
                            decodedChar := characterDecoder encode:byte.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2990
                        ].    
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2991
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2992
                        charPrinted := replacementForUnprintable.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2993
                        decodedChar notNil ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2994
                            ((decodedChar between:32 and:127) or:[(decodedChar between:(128+32) and:(128+127))]) ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2995
                                charPrinted := Character value:decodedChar.
16188
26fe162be79f #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 16160
diff changeset
  2996
                            ] ifFalse:[
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2997
                                (decodedChar between:0 and:31) ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2998
                                    "/ the 'nul', 'soh' .. 'gs' chars in unicodePage 2400
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2999
                                    "/ are perfect here, but usually not available in the font
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3000
                                    "/ and we have currently no way of knowing if they are...
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3001
                                    "/ (could let the font draw into a bitmap and check if there is something...)
18264
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
  3002
                                    "/ For now, write a dot.·
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3003
                                    "/ charPrinted := (Character value:(byte + 16r2400))
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3004
                                ].
16188
26fe162be79f #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 16160
diff changeset
  3005
                            ].
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3006
                        ].
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3007
                        asciiLineStream nextPut:charPrinted.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3008
                    ].
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3009
                ].
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3010
                line := (lineStream contents paddedTo:(addrDigits + 1 + ((colsPerByte+1)*16) + 6))
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3011
                        , asciiLineStream contents.
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3012
            ].
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3013
            line
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3014
        ].
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3015
    ^ lines.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3016
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3017
    "Created: / 12-11-2017 / 11:24:29 / cg"
17750
c55331a80c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17746
diff changeset
  3018
    "Modified: / 12-11-2017 / 14:17:59 / cg"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3019
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3020
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3021
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3022
    "utility helper: generate a hexDump with addresses; the character columns at the right show
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3023
     the iso8859-1 characters"
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3024
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3025
    ^ self
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3026
        contentsOfBytesAsDump:data base:16
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3027
        numberOfAddressDigits:addrDigits
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3028
        addressStart:virtualStart
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3029
        characterEncoding:#'iso8859-1'
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3030
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3031
    "Created: / 13-02-2012 / 15:01:46 / cg"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3032
    "Modified: / 12-11-2017 / 12:07:12 / cg"
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3033
    "Modified: / 14-11-2017 / 17:48:19 / mawalch"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3034
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3035
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3036
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3037
    "utility helper: generate a hexDump with addresses;
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3038
     characterEncodingSymbol determines how characters are to be shown in the right (character) columns.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3039
     By default, this is iso8859-1, but supported are also ebcdic and ascii7,
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3040
     to support display of alien encoded binary data."
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3041
    
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3042
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3043
        contentsOfBytesAsDump:data base:16
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3044
        numberOfAddressDigits:addrDigits
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3045
        addressStart:virtualStart
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3046
        characterEncoding:characterEncodingSymbol
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3047
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3048
    "Created: / 12-11-2017 / 11:21:44 / cg"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3049
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3050
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3051
contentsOfFileAsDump:f base:numberBase withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3052
    "opens the file, get its contents and generates a dump for it"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3053
    
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3054
    |resources fileName stream data offs 
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3055
     addrDigits lines answer sizeLimit showLastPart setNewLimit thisFileSizeString|
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3056
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3057
    resources := self classResources.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3058
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3059
    fileName := f baseName.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3060
    f isDirectory ifTrue:[
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3061
        Dialog warn:(resources string:'%1 is a directory.' with:fileName).
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3062
        ^ nil
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3063
    ].
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3064
    f exists ifFalse:[
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3065
        Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName).
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3066
        ^ nil
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3067
    ].
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3068
    f isReadable ifFalse:[
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3069
        Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName).
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3070
        ^ nil
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3071
    ].
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3072
    f fileSize > (self maxFileSizeShownWithoutAsking) ifTrue:[
8472
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3073
        limitOrNil notNil ifTrue:[
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3074
            sizeLimit := limitOrNil.
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3075
            showLastPart := showLastPartOrNil
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3076
        ] ifFalse:[
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3077
            setNewLimit := false.
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3078
            thisFileSizeString := (UnitConverter fileSizeStringFor:f fileSize).
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3079
            
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3080
            Dialog 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3081
                withOptoutOption:[ setNewLimit := true ]
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3082
                labelled:(resources string:'No longer ask for files smaller than %1' with:thisFileSizeString)
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3083
                do:[
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3084
                    answer := Dialog 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3085
                                    confirmWithCancel:(resources
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3086
                                                        stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3087
                                                        with:(fileName contractTo:40) allBold 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3088
                                                        with:thisFileSizeString)
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3089
                                    labels:#('Cancel' 'Show All' 'Show First Part' ).
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3090
                ].
8472
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3091
            answer isNil ifTrue:[^ nil].
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3092
            answer ifTrue:[
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  3093
                sizeLimit := (4 * 1024 * 1024) "max:self maxFileSizeShownWithoutAsking".
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3094
            ] ifFalse:[
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3095
                setNewLimit ifTrue:[
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3096
                    self maxFileSizeShownWithoutAsking:(self maxFileSizeShownWithoutAsking max:f fileSize).
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3097
                ].    
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3098
            ].    
8436
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3099
        ].
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3100
    ].
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3101
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3102
    stream := f readStream binary.
8436
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3103
    sizeLimit notNil ifTrue:[
8472
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3104
        showLastPart == true ifTrue:[
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3105
            stream position:(f fileSize - sizeLimit).
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3106
        ].
8436
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3107
        data := stream nextBytes:sizeLimit.
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3108
    ] ifFalse:[
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3109
        data := stream contents.
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3110
    ].
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3111
    stream close.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3112
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3113
    offs := 0.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3114
    lines := StringCollection new.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3115
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3116
    addrDigits := ((f fileSize + 1) log:16) truncated + 1.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3117
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3118
    ^ self 
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3119
        contentsOfBytesAsDump:data base:numberBase
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3120
        numberOfAddressDigits:addrDigits
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3121
        addressStart:0
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3122
        characterEncoding:characterEncoding
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3123
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3124
    "Created: / 12-11-2017 / 12:08:10 / cg"
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  3125
    "Modified: / 19-11-2017 / 15:01:34 / cg"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3126
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3127
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3128
contentsOfFileAsHexDump:f 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3129
    "opens the file, get its contents and generates a dump for it"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3130
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3131
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3132
        contentsOfFileAsHexDump:f
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3133
        withLimit:nil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3134
        lastPart:nil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3135
        characterEncoding:#'iso8859-1'
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3136
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3137
    "Modified (comment): / 12-11-2017 / 12:09:30 / cg"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3138
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3139
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3140
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3141
    "opens the file, get its contents and generates a dump for it"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3142
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3143
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3144
        contentsOfFileAsHexDump:f
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3145
        withLimit:limitOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3146
        lastPart:showLastPartOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3147
        characterEncoding:#'iso-8859-1'
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3148
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3149
    "Modified (comment): / 12-11-2017 / 12:09:34 / cg"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3150
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3151
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3152
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3153
    "opens the file, get its contents and generates a dump for it"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3154
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3155
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3156
        contentsOfFileAsDump:f base:16
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3157
        withLimit:limitOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3158
        lastPart:showLastPartOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3159
        characterEncoding:characterEncoding
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3160
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3161
    "Created: / 12-11-2017 / 12:02:05 / cg"
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3162
! !
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3163
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3164
!AbstractFileBrowser class methodsFor:'utilities - files'!
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3165
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3166
allFilesInDirectories:directories forWhich:aBlock
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3167
    |allFiles|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3168
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3169
    directories isEmpty ifTrue:[^ #()].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3170
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3171
    allFiles := OrderedCollection new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3172
    directories do:[:dir|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3173
        [
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3174
            |fileNames|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3175
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3176
            fileNames := dir directoryContents.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3177
            fileNames notNil ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3178
                fileNames := fileNames 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3179
                                collect:[:fn | dir construct:fn]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3180
                                thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3181
                allFiles addAll:fileNames.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3182
            ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3183
        ] on:FileStream openErrorSignal do:[:ex|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3184
            self warn:(self classResources stringWithCRs:'Cannot access: %1\(%2)' 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3185
                            with:ex pathName
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3186
                            with:ex description).
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3187
            ex proceedWith:nil.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3188
        ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3189
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3190
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3191
    ^ allFiles
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3192
!
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3193
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3194
fileFindDuplicatesIn:directories
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3195
    "scan directories for duplicate files.
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  3196
     return a dictionary mapping duplicate files to their original;
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  3197
     the oldest file found will be the value (original), the younger files (copies) will be the keys.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3198
     Files without duplicate(s) will not have an entry in the dictionary."
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3199
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3200
    |infoDir filesBySize anySameSized 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3201
     result allFiles|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3202
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3203
    directories isEmpty ifTrue:[^ #()].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3204
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3205
    allFiles := self allFilesInDirectories:directories forWhich:[:f | true].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3206
    allFiles isEmpty ifTrue:[^ #()].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3207
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3208
    "/ for each, get the file's info (size, modificationTime etc.).
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3209
    infoDir := Dictionary new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3210
    allFiles do:[:fn |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3211
        infoDir at:fn put:(fn info)
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3212
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3213
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3214
    "/ in a first pass, collect groups by the same size
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3215
    "/ remember those fileSizes for which multiple files exist
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3216
    filesBySize := Dictionary new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3217
    anySameSized := false.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3218
    infoDir keysAndValuesDo:[:fn :info |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3219
        |sz entry|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3220
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3221
        sz := info fileSize.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3222
        entry := filesBySize at:sz ifAbsentPut:[Set new].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3223
        entry add:fn.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3224
        entry size > 1 ifTrue:[ anySameSized := true ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3225
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3226
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3227
    "/ any of same size ?
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3228
    anySameSized ifFalse:[^ #() ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3229
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3230
    result := Dictionary new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3231
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3232
    "/ now walk over the same-sized files and compare the contents.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3233
    filesBySize do:[:entry |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3234
        |files|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3235
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3236
        entry size > 1 ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3237
            files := entry asArray.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3238
            files 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3239
                sort:[:a :b |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3240
                    |tA tB|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3241
                    tA := (infoDir at:a) modificationTime.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3242
                    tB := (infoDir at:b) modificationTime.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3243
                    tA < tB
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3244
                ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3245
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3246
            1 to:files size-1 do:[:idx1 |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3247
                |fn1|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3248
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3249
                fn1 := files at:idx1.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3250
                idx1+1 to:files size do:[:idx2 |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3251
                    |fn2|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3252
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3253
                    fn2 := files at:idx2.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3254
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3255
                    (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3256
                        "/ compare the files
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3257
                        (fn1 sameContentsAs:fn2) ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3258
                            "/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  3259
                            result at:fn2 put:fn1.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3260
                        ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3261
                    ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3262
                ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3263
            ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3264
        ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3265
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3266
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3267
    result := result associations copy.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3268
"/    result := result collect:[:assoc |
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3269
"/                                    |f1 f2|
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3270
"/
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3271
"/                                    f1 := assoc key asString.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3272
"/                                    f2 := assoc value asString.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3273
"/                                    f1 < f2 ifTrue:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3274
"/                                        f2 -> f1
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3275
"/                                    ] ifFalse:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3276
"/                                        f1 -> f2
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3277
"/                                    ]
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3278
"/                            ].
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3279
    "/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3280
    result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value].
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3281
    result sort:[:f1 :f2 | f1 key < f2 key].
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3282
    ^ result
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3283
! !
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3284
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3285
!AbstractFileBrowser methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3286
321c1729db5b initial checkin
penk
parents:
diff changeset
  3287
askForCommandFor:fileName thenDo:aBlock
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  3288
    "setup and launch a querybox to ask for a unix command.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3289
     Then evaluate aBlock passing the command-string as argument."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3290
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3291
    |box osName commandString alwaysOpenLikeThisHolder openCmd suffix|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3292
321c1729db5b initial checkin
penk
parents:
diff changeset
  3293
    osName := OperatingSystem platformName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3294
321c1729db5b initial checkin
penk
parents:
diff changeset
  3295
    box := FilenameEnterBox 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3296
                title:(resources string:'Execute %1 command:' with:osName)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3297
               okText:(resources string:'Execute')
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3298
               action:[:cmd | commandString := cmd].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3299
321c1729db5b initial checkin
penk
parents:
diff changeset
  3300
    fileName notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3301
        self initialCommandFor:fileName into:box.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3302
    ].
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3303
    alwaysOpenLikeThisHolder := false asValue.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3304
    box verticalPanel add:((CheckBox label:'Always use this command for this file type') model:alwaysOpenLikeThisHolder).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3305
    box directory:(self getDirWithoutFileName:fileName).
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3306
    box open.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3307
    
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3308
    "/ box destroy.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3309
    alwaysOpenLikeThisHolder value ifTrue:[
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3310
        openCmd := commandString upTo:$".
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3311
        suffix := fileName suffix.
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3312
        UserPreferences current 
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3313
            defaultFileOpenCommandFor:suffix put:(openCmd,' "%1"');
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3314
            beModified.
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3315
        self breakPoint:#cg.
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3316
    ].
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3317
    
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3318
    commandString notNil ifTrue:[
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3319
        aBlock value:commandString
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3320
    ].
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3321
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3322
    "Modified: / 7.9.1995 / 10:31:54 / claus"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3323
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3324
    "Modified: / 14.8.1998 / 14:12:52 / cg"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3325
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3326
321c1729db5b initial checkin
penk
parents:
diff changeset
  3327
changeFileBrowserTitleTo:aString
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3328
    self 
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3329
        applicationNamed:#FileBrowserV2 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3330
        ifPresentDo:[:app | app changeFileBrowserTitleTo:aString]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3331
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3332
321c1729db5b initial checkin
penk
parents:
diff changeset
  3333
copyFileList
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3334
    "copy the fileList to the clipBoard"
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3335
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3336
    |fileList|
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3337
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3338
    fileList := self 
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3339
                    applicationNamed:#DirectoryContentsBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3340
                    ifPresentDo:[:app | app browserFileList].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3341
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3342
    fileList notNil ifTrue:[
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3343
        self copyFileListToClipBoard:fileList.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3344
    ]
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3345
!
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3346
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3347
copyFileListToClipBoard:fileList
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3348
    "copy the itemList to the clipBoard"
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3349
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3350
    |stream|
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3351
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3352
    fileList isEmpty ifTrue:[^ self].
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3353
5772
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3354
    stream := String writeStream.
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3355
    fileList size == 1 ifTrue:[
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3356
        stream nextPutAll:(fileList first asString).
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3357
    ] ifFalse:[
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3358
        fileList do:[:fileName |
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3359
            (fileName baseName ~= '..') ifTrue:[
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3360
                stream nextPutLine:(fileName asString).
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3361
            ]
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3362
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3363
    ].
6034
7f7d4b7362dd set selection interface changed
ca
parents: 6031
diff changeset
  3364
    self window setClipboardText:stream contents.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3365
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3366
321c1729db5b initial checkin
penk
parents:
diff changeset
  3367
copySelectedFilenames
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3368
    "copy the selected fileNames to the clipBoard"
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3369
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3370
    |fileList|
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3371
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3372
    fileList := self 
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3373
                    applicationNamed:#DirectoryContentsBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3374
                    ifPresentDo:[:appl | appl selectedFileNames].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3375
    fileList notNil ifTrue:[
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3376
        self copyFileListToClipBoard:fileList.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3377
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3378
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3379
10923
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3380
doAddArchiver
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3381
    |files|
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3382
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3383
    files := self currentSelectedFiles.
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3384
    files size == 1 ifFalse:[
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  3385
        Dialog information:(resources string:'Select exactly one archive.').
10923
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3386
        ^ self
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3387
    ].
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3388
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3389
    self 
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3390
        applicationNamed:#FileApplicationNoteBook
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3391
        ifPresentDo:[:appl | appl doAddArchiverOn:files first].
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3392
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3393
    "Created: / 29-11-2011 / 19:01:31 / cg"
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  3394
    "Modified: / 29-11-2017 / 12:25:47 / cg"
10923
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3395
!
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3396
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3397
doAddTerminal
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3398
    |dir|
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3399
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3400
    dir := self currentDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3401
    
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3402
    dir isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3403
        dir :=  Filename homeDirectory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3404
    ].
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3405
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3406
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3407
        applicationNamed:#FileApplicationNoteBook
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3408
        ifPresentDo:[:appl | appl addTerminalIn:dir].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3409
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3410
321c1729db5b initial checkin
penk
parents:
diff changeset
  3411
doOpenSearchFile
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3412
    |item file|
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3413
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3414
    file := self firstSelectedFileName.
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3415
    file isNil ifTrue:[
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3416
        file := Filename homeDirectory asAbsoluteFilename.
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3417
    ].
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3418
    item := DirectoryContentsBrowser itemClass fileName:file.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3419
    self openSearchFileOn:item.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3420
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3421
321c1729db5b initial checkin
penk
parents:
diff changeset
  3422
doShowFileContents
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3423
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3424
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3425
        ifPresentDo:[:appl | ^ appl doShowFileContents].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3426
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3427
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3428
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3429
321c1729db5b initial checkin
penk
parents:
diff changeset
  3430
doShowProperties
321c1729db5b initial checkin
penk
parents:
diff changeset
  3431
    "show long stat (file)-info"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3432
321c1729db5b initial checkin
penk
parents:
diff changeset
  3433
    self fileGetInfo:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3434
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3435
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3436
enterAction
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3437
    self 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3438
        applicationNamed:#DirectoryContentsBrowser 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3439
        ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl enterAction ]].
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3440
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3441
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3442
fileEncodingDialog
14497
6d95f7c8d28e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14419
diff changeset
  3443
    "open a dialog to allow change of the file's character encoding.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3444
     Files are converted to internal encoding when read, and converted back
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3445
     to this encoding when saved.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3446
     Notice: currently, not too many encodings are supported by the system."
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3447
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3448
    |bindings encodings encodingDescr idx selectedEncoding|
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3449
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3450
    encodingDescr := CharacterEncoder supportedExternalEncodings.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3451
    encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3452
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3453
    bindings := IdentityDictionary new.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3454
    bindings at:#encodingList put:encodingDescr.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3455
    bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue.
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3456
    bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue).
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3457
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3458
    (self openDialogInterface:#encodingDialogSpec withBindings:bindings)
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3459
    ifTrue:[
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3460
        idx := (bindings at:#selectedEncoding) value.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3461
        selectedEncoding := encodings at:idx.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3462
        selectedEncoding notNil ifTrue:[
5704
82093ade9b35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5673
diff changeset
  3463
            self fileEncoding:selectedEncoding asSymbol.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3464
        ].
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3465
        self lockFileEncoding:(bindings at:#lockFileEncoding) value.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3466
    ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3467
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3468
    "Modified: 30.6.1997 / 14:41:12 / cg"
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3469
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3470
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3471
gotoFile:aFilename 
5380
2f738f3a34b1 fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3472
    "select only if the file is not already in the selection"
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3473
    
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3474
    |currentFileNameHolder currentSel|
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3475
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3476
    currentFileNameHolder := self currentFileNameHolder.
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3477
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3478
    currentSel := currentFileNameHolder value.
5380
2f738f3a34b1 fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3479
    (currentSel includes:aFilename) ifFalse:[
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3480
        self withWaitCursorDo:[
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3481
            currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)).
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3482
        ]
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3483
    ].
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3484
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3485
    "Modified: / 29-12-2010 / 11:04:29 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3486
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3487
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3488
lineEndConventionDialog
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3489
    "open a dialog to allow change of the line end conventions
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3490
     (when writing files)"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3491
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3492
    |bindings|
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3493
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3494
    bindings := IdentityDictionary new.
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3495
    bindings at:#lineEndConvention put:(self lineEndConvention asValue).
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3496
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3497
    (self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings)
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3498
    ifTrue:[
15208
c02c92b1c524 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15189
diff changeset
  3499
        self lineEndConventionHolder value:(bindings at:#lineEndConvention) value asSymbol
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3500
    ].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3501
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3502
    "Created: / 06-01-2012 / 15:34:51 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3503
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3504
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3505
newTextEditor
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3506
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3507
        applicationNamed:#FileApplicationNoteBook
15936
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3508
        ifPresentDo:[:appl | 
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3509
            |editor files item|
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3510
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3511
            editor := appl newTextEditor.
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3512
            (files := self currentSelectedFiles) size == 1 ifTrue:[
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3513
                item := DirectoryContentsBrowser itemClass fileName:files first.
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3514
                editor item:item.     
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3515
            ].    
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3516
            ^ editor
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3517
        ].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3518
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3519
    ^ nil.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3520
!
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3521
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3522
openApplByFileItem:anItem
8490
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3523
    "/ q: is the following always wanted ?
9267
a8afd9424514 changed: #openApplByFileItem:
Stefan Vogel <sv@exept.de>
parents: 9206
diff changeset
  3524
    self window sensor shiftDown ifFalse:[
17715
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3525
        ((anItem mimeType startsWith:'application/x-expecco-') 
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3526
         and:[(Smalltalk at:#ExpeccoStartup) notNil]) ifTrue:[
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3527
            (Smalltalk at:#ExpeccoStartup) main:{anItem fileName asString}.
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3528
            ^ self.
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3529
        ].
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3530
10669
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3531
        "/ cg: no - batch and shell scripts are to be
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3532
"/        anItem fileName isExecutableProgram ifTrue:[
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3533
"/            self executeCommand:anItem fileName pathName.
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3534
"/            ^ self.
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3535
"/        ].
9267
a8afd9424514 changed: #openApplByFileItem:
Stefan Vogel <sv@exept.de>
parents: 9206
diff changeset
  3536
8490
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3537
"/        OperatingSystem isMSWINDOWSlike ifTrue:[
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3538
"/            Error handle:[:ex |
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3539
"/            ] do:[
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3540
"/                OperatingSystem
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3541
"/                    shellExecute:nil
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3542
"/                    lpOperation:'open'
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3543
"/                    lpFile:(anItem fileName pathName)
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3544
"/                    lpParameters:nil
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3545
"/                    lpDirectory:(self directory pathName)
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3546
"/                    nShowCmd:#SW_SHOWNORMAL.
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3547
"/                ^ self.
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3548
"/            ]
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3549
"/        ]
9267
a8afd9424514 changed: #openApplByFileItem:
Stefan Vogel <sv@exept.de>
parents: 9206
diff changeset
  3550
    ].
5306
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
  3551
    ^ self 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3552
        applicationNamed:#FileApplicationNoteBook
5306
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
  3553
        ifPresentDo:[:appl | appl openApplByFileItem:anItem].
10669
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3554
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3555
    "Modified: / 06-09-2011 / 11:11:15 / cg"
17715
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3556
    "Modified: / 18-10-2017 / 10:15:15 / stefan"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3557
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3558
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3559
openApplForFile:aFilename
5306
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
  3560
    ^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename).
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3561
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3562
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3563
openCommandResultApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  3564
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3565
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3566
        applicationNamed:#FileApplicationNoteBook
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3567
        ifPresentDo:[:appl | ^ appl openCommandResultApplication].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3568
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3569
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3570
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3571
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3572
openNewTextEditorOn:anItem
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3573
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3574
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3575
        ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3576
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3577
    ^ nil
4880
87f511659680 edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents: 4878
diff changeset
  3578
!
87f511659680 edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents: 4878
diff changeset
  3579
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3580
openSearchFileOn:anItem
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3581
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3582
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3583
        ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3584
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3585
    ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3586
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3587
5162
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3588
openTextEditorForFile:aFilename
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3589
    ^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename).
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3590
!
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3591
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3592
openTextEditorOn:anItem
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3593
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3594
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3595
        ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3596
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3597
    ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3598
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3599
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3600
openTextEditorOn:anItem type:aDirDescrOrFile
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3601
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3602
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3603
        ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3604
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3605
    ^ nil.
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3606
!
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3607
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3608
setCurrentFileName:aFilename 
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3609
    self setCurrentFileNames:(OrderedCollection with:aFilename).
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3610
!
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3611
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3612
setCurrentFileNames:aCollectionOfFilenames 
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3613
    self currentFileNameHolder value:aCollectionOfFilenames.
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3614
!
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3615
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3616
tabStopConversionDialog
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3617
    "open a dialog to allow change of the tab stop conversion (when reading/writing files)"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3618
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3619
    |bindings|
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3620
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3621
    bindings := IdentityDictionary new.
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3622
    bindings at:#tabStops put:(self inputTabColumnConversion asValue).
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3623
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3624
    (self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings)
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3625
    ifTrue:[
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3626
        self inputTabColumnConversionHolder value:(bindings at:#tabStops) value
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3627
    ].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3628
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3629
    "Created: / 06-01-2012 / 15:36:06 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3630
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3631
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3632
updateAndSelect:aColOfFiles
4785
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  3633
    self updateCurrentDirectory.
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  3634
    aColOfFiles notNil ifTrue:[ 
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3635
        self setCurrentFileNames:aColOfFiles 
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  3636
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3637
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3638
321c1729db5b initial checkin
penk
parents:
diff changeset
  3639
updateCurrentDirectory
5739
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3640
    self updateCurrentDirectory:false
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3641
!
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3642
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3643
updateCurrentDirectory:withReread
4785
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  3644
    DirectoryContents flushCachedDirectoryFor:(self getBestDirectory).
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  3645
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3646
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3647
        applicationNamed:#DirectoryContentsBrowser 
5739
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3648
        ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3649
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3650
        applicationNamed:#DirectoryTreeBrowser     
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3651
        ifPresentDo:[:appl | appl doUpdate].
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3652
!
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3653
5739
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3654
updateCurrentDirectoryWithReread
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3655
    self updateCurrentDirectory:true
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3656
!
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3657
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3658
withActivityIndicationDo:aBlock
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3659
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3660
    self activityVisibilityChannel value:true.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3661
    [
9361
bad1ef34ac86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
  3662
        self withWaitCursorDo:[
bad1ef34ac86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
  3663
            aBlock value.
bad1ef34ac86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
  3664
        ]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3665
    ] ensure:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3666
        self activityVisibilityChannel value:false.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3667
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3668
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3669
321c1729db5b initial checkin
penk
parents:
diff changeset
  3670
!AbstractFileBrowser methodsFor:'actions bookmarks'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3671
321c1729db5b initial checkin
penk
parents:
diff changeset
  3672
addBookmark
321c1729db5b initial checkin
penk
parents:
diff changeset
  3673
    self currentFilesAreInSameDirectory ifFalse:[^ self].
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3674
    self addBookmarks:(self currentSelectedDirectories).
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3675
    self class saveBookmarksInDefaultBookmarksFile
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3676
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3677
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3678
addBookmarks:aColOfDirectories
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3679
    aColOfDirectories do:[ :path |
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3680
        self class addBookmark:path
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3681
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3682
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3683
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
  3684
editBookmarks
17849
6b238844d1c0 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17831
diff changeset
  3685
    self class editBookmarksWithDefault: self currentSelectedDirectories firstOrNil.
6b238844d1c0 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17831
diff changeset
  3686
6b238844d1c0 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17831
diff changeset
  3687
    "Modified: / 13-12-2017 / 23:24:39 / stefan"
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
  3688
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
  3689
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3690
hasBookmarks
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3691
    ^ self class hasBookmarks
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3692
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3693
321c1729db5b initial checkin
penk
parents:
diff changeset
  3694
hasBookmarksToRemove
321c1729db5b initial checkin
penk
parents:
diff changeset
  3695
    |bookmarks directories|
321c1729db5b initial checkin
penk
parents:
diff changeset
  3696
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  3697
    directories := self currentSelectedDirectories.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3698
    bookmarks := self class directoryBookmarks.
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  3699
    ^ (bookmarks notEmptyOrNil and:[directories notEmpty])
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  3700
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  3701
    "Modified: / 17-02-2017 / 08:25:22 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3702
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3703
321c1729db5b initial checkin
penk
parents:
diff changeset
  3704
removeBookmark
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3705
    self currentSelectedDirectories do:[:dir|
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3706
        self class removeBookmark:dir
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3707
    ].
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3708
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3709
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3710
saveBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3711
     self class saveBookmarks
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3712
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3713
321c1729db5b initial checkin
penk
parents:
diff changeset
  3714
!AbstractFileBrowser methodsFor:'actions history'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3715
321c1729db5b initial checkin
penk
parents:
diff changeset
  3716
addToCommandHistory:aCommandString for:aFilename
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3717
    |cmd suffix cmdHist historySize|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3718
321c1729db5b initial checkin
penk
parents:
diff changeset
  3719
    cmdHist := self class commandHistory.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6479
diff changeset
  3720
    (aCommandString notEmptyOrNil) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3721
        cmdHist notNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3722
            cmdHist addFirst:aCommandString.
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3723
            historySize := self class commandHistorySize.
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3724
            (historySize notNil and:[cmdHist size > historySize]) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3725
                cmdHist removeLast
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3726
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3727
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3728
        aFilename notNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3729
            cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3730
            DefaultCommandPerSuffix isNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3731
                DefaultCommandPerSuffix := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3732
            ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3733
            suffix := aFilename asFilename suffix.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3734
            suffix notNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3735
                DefaultCommandPerSuffix at:suffix put:cmd.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3736
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3737
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3738
    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3739
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3740
321c1729db5b initial checkin
penk
parents:
diff changeset
  3741
doBack
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6284
diff changeset
  3742
    "go backward in the history"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3743
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3744
    | fileName|
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3745
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3746
    fileName := self directoryHistory goBackward.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3747
    fileName notNil ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  3748
        self gotoFile:(fileName asFilename).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3749
    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3750
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3751
321c1729db5b initial checkin
penk
parents:
diff changeset
  3752
doForward
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6284
diff changeset
  3753
    "go forward in the history"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3754
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  3755
    | fileName|
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  3756
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3757
    fileName := self directoryHistory goForward.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3758
    fileName notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3759
        self gotoFile:(fileName asFilename).
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3760
    ] ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3761
        self enableForward value:false.
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3762
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3763
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3764
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3765
321c1729db5b initial checkin
penk
parents:
diff changeset
  3766
!AbstractFileBrowser methodsFor:'applications'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3767
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3768
applicationNamed:anApplicationName ifPresentDo:aBlock
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3769
    |appl|
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3770
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3771
    appl := self applications at:anApplicationName ifAbsent:nil.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3772
    appl notNil ifTrue:[
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3773
        ^ aBlock value:appl
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3774
    ].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3775
    ^ nil.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3776
!
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3777
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  3778
directoryContentsBrowser
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  3779
    ^ self applications at:#DirectoryContentsBrowser ifAbsent:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3780
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3781
321c1729db5b initial checkin
penk
parents:
diff changeset
  3782
!AbstractFileBrowser methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3783
321c1729db5b initial checkin
penk
parents:
diff changeset
  3784
applications
321c1729db5b initial checkin
penk
parents:
diff changeset
  3785
    ^ aspects at:#applications
321c1729db5b initial checkin
penk
parents:
diff changeset
  3786
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3787
321c1729db5b initial checkin
penk
parents:
diff changeset
  3788
backgroundProcesses
321c1729db5b initial checkin
penk
parents:
diff changeset
  3789
321c1729db5b initial checkin
penk
parents:
diff changeset
  3790
    ^ self aspectFor:#backgroundProcesses ifAbsent:[List new]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3791
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3792
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  3793
canMake
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3794
    ^ self aspectFor:#canMake ifAbsent:[ ValueHolder with:false ].
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  3795
!
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  3796
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3797
canOpenChangeBrowser
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3798
    ^ self aspectFor:#canOpenChangeBrowser ifAbsent:[ false asValue ].
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3799
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3800
    "Created: / 30-06-2018 / 18:29:53 / Claus Gittinger"
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3801
!
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3802
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3803
currentDirectories
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3804
    " returns a holder on a Collection of all currently selected directories  
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3805
      if only a file is selected, currentDirectories holds the directory of the file
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3806
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3807
321c1729db5b initial checkin
penk
parents:
diff changeset
  3808
    ^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3809
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3810
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3811
currentDirectoriesValue
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3812
    " returns a Collection of all currently selected directories  
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3813
      if only a file is selected, currentDirectories holds the directory of the file
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3814
    "
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3815
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3816
    ^ self currentDirectories value
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3817
!
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3818
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3819
currentDirectory
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3820
    "return the single current directory or nil"
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3821
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3822
    |directories|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3823
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3824
    directories := self currentSelectedDirectories.
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3825
    (directories size ~= 1) ifTrue:[
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3826
        ^ nil
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3827
    ].
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3828
    ^ directories first.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3829
!
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3830
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3831
currentDirectoryDisplayed
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3832
    "Return a directory as Filename that is currently displayed in the browser"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3833
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3834
    ^self subclassResponsibility
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3835
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3836
    "Created: / 14-01-2013 / 11:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3837
!
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3838
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3839
currentFileNameHolder
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3840
    "return a ValueHolder with an OrderedCollection containing all selected files.
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3841
     If no file but a directory is selected it contains the directories 
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3842
     in contrast to currentDirectories which have only the directories"
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3843
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3844
    ^ self aspectFor:#currentFileNameHolder 
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3845
        ifAbsent:[
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3846
            |currentSel|    
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  3847
4692
f87e230b4688 Shelter class variable from rubbish.
martin
parents: 4684
diff changeset
  3848
            currentSel := self class currentSelection.
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3849
            currentSel isEmpty ifTrue:[
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3850
                currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3851
            ].
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3852
            currentSel asValue
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3853
        ] 
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3854
        notPresentDo:[:holder|
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3855
            |filenames newFilenames|
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3856
            filenames := holder value.
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3857
            newFilenames := Set new.
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3858
            filenames do:[:eachFilename|  
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3859
                |existingFilename|
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3860
                existingFilename := eachFilename. 
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3861
                existingFilename notNil ifTrue:[
9649
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3862
                    [existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3863
                        existingFilename := existingFilename directory.
4955
378481247391 if no item is selected directory up action do nothing now
penk
parents: 4950
diff changeset
  3864
                    ].
9649
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3865
                    existingFilename exists ifTrue:[
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3866
                        newFilenames add:existingFilename.
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3867
                    ].
4955
378481247391 if no item is selected directory up action do nothing now
penk
parents: 4950
diff changeset
  3868
                ]
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3869
            ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3870
            newFilenames asOrderedCollection.
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3871
        ]
9649
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3872
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3873
    "Modified: / 27-11-2010 / 15:42:45 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3874
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3875
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3876
defaultFileEncoding
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3877
    ^ #'iso8859-1' "/ #'utf-8'
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3878
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3879
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3880
enableDirectoryUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  3881
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3882
    ^ self aspectFor:#enableDirectoryUp ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3883
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3884
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3885
enableGotoDefaultDirectory
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3886
    ^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ ValueHolder with:true ].
4593
a2b057480bfc added gotoDefault button
Claus Gittinger <cg@exept.de>
parents: 4585
diff changeset
  3887
!
a2b057480bfc added gotoDefault button
Claus Gittinger <cg@exept.de>
parents: 4585
diff changeset
  3888
8168
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  3889
enableGotoDesktop
14308
192c81c86815 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14298
diff changeset
  3890
    "/ backward compatibility
192c81c86815 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14298
diff changeset
  3891
    ^ self enableGotoDesktopDirectory.
8168
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  3892
!
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  3893
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3894
enableGotoDesktopDirectory
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3895
    ^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ ValueHolder with:true ].
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3896
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3897
    "Created: / 01-10-2010 / 16:19:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3898
!
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3899
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  3900
enableGotoSmalltalkDirectory
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3901
    ^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ].
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  3902
!
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  3903
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3904
enableGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3905
    ^ self aspectFor:#enableGotoSmalltalkWorkspaceDirectory ifAbsent:[ true asValue ].
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3906
!
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3907
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3908
enableGotoTempDirectory
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3909
    ^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ].
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3910
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3911
    "Created: / 29-12-2010 / 11:01:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3912
!
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3913
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3914
enableHome
321c1729db5b initial checkin
penk
parents:
diff changeset
  3915
321c1729db5b initial checkin
penk
parents:
diff changeset
  3916
    ^ self aspectFor:#enableHome ifAbsent:[ true asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3917
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3918
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3919
enableMakeCurrentDirectory
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3920
    ^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ].
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3921
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3922
    "Created: / 26-10-2010 / 17:17:58 / cg"
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3923
!
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3924
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3925
enableViewNoteBookApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  3926
321c1729db5b initial checkin
penk
parents:
diff changeset
  3927
    ^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3928
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3929
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3930
fileEncoding
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3931
    ^ self fileEncodingHolder value
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3932
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3933
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3934
fileEncoding:newEncoding
5533
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3935
    self fileEncodingHolder value:newEncoding.
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3936
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3937
    self 
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3938
        applicationNamed:#FileApplicationNoteBook
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3939
        ifPresentDo:[:nb | 
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3940
            |appl|
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3941
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3942
            appl := nb selectedApplication.
5535
f19a31cf305d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
  3943
            (appl notNil and:[appl isTextEditor]) ifTrue:[
5533
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3944
                appl fileEncoding:newEncoding
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3945
            ]
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3946
        ].
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3947
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3948
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3949
fileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3950
    ^ self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3951
        aspectFor:#fileEncodingHolder 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3952
        ifAbsent:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3953
            self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3954
                applicationNamed:#FileApplicationNoteBook
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3955
                ifPresentDo:[:appl | appl fileEncodingHolder].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3956
        ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3957
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3958
17485
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  3959
fileEntryFieldHolder
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  3960
    ^ self subclassResponsibility.
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  3961
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  3962
    "Created: / 31-03-2017 / 11:36:49 / stefan"
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  3963
!
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  3964
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3965
firstSelectedFileName
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3966
    |files|
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3967
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  3968
    files := self currentSelectedObjects.
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3969
    files notEmpty ifTrue:[
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3970
        ^ files first
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3971
    ].
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3972
    ^ nil
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  3973
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  3974
    "Modified: / 04-12-2006 / 13:14:53 / cg"
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3975
!
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3976
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3977
gotoDefaultDirectoryIsVisible
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3978
    ^ true.
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3979
"/    ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename).
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3980
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3981
    "Modified: / 26-10-2010 / 17:23:51 / cg"
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3982
!
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3983
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3984
gotoDesktopDirectoryIsVisible
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3985
    Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false].
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3986
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3987
    ^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename).
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3988
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3989
    "Created: / 01-10-2010 / 16:26:27 / cg"
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3990
!
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3991
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3992
hasFileSelection
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3993
    ^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ].
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3994
!
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3995
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  3996
hasNotTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  3997
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  3998
        aspectFor:#hasNotTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  3999
        ifAbsent:[
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4000
            BlockValue 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4001
                with:[:m | self hasTwoDirectoriesSelected not]
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4002
                argument:self currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4003
        ].
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4004
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4005
    "Created: / 20-05-2010 / 10:45:50 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4006
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4007
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4008
hasNotTwoFilesSelectedHolder
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4009
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4010
        aspectFor:#hasNotTwoFilesSelectedHolder
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4011
        ifAbsent:[
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4012
            BlockValue 
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4013
                with:[:m | self hasTwoFilesSelected not]
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4014
                argument:self currentFileNameHolder
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4015
        ].
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4016
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4017
    "Modified: / 20-05-2010 / 10:46:01 / cg"
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4018
!
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4019
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4020
hasSelection
17923
75e9605da9f0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17889
diff changeset
  4021
    "aspect holding true, if a file is selected"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4022
321c1729db5b initial checkin
penk
parents:
diff changeset
  4023
    ^ self aspectFor:#hasSelection ifAbsent:[ false asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4024
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4025
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4026
hasTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4027
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4028
        aspectFor:#hasTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4029
        ifAbsent:[
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4030
            BlockValue 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4031
                with:[:m | self hasTwoDirectoriesSelected]
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4032
                argument:self currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4033
        ].
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4034
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4035
    "Created: / 20-05-2010 / 10:45:41 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4036
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4037
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4038
hasTwoFilesSelectedHolder
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4039
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4040
        aspectFor:#hasTwoFilesSelectedHolder
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4041
        ifAbsent:[
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4042
            BlockValue 
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4043
                with:[:m | self hasTwoFilesSelected]
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4044
                argument:self currentFileNameHolder
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4045
        ].
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4046
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4047
    "Modified: / 20-05-2010 / 10:46:08 / cg"
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4048
!
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4049
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4050
inputTabColumnConversion
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4051
    ^ self inputTabColumnConversionHolder value
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4052
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4053
    "Created: / 06-01-2012 / 15:25:56 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4054
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4055
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4056
inputTabColumnConversionHolder
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4057
    ^ self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4058
        aspectFor:#inputTabColumnConversionHolder 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4059
        ifAbsent:[
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4060
            self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4061
                applicationNamed:#FileApplicationNoteBook
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4062
                ifPresentDo:[:appl | appl inputTabColumnConversionHolder].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4063
        ]
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4064
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4065
    "Created: / 06-01-2012 / 15:26:16 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4066
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4067
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4068
lineEndConvention
15208
c02c92b1c524 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15189
diff changeset
  4069
    ^ self lineEndConventionHolder value asSymbol
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4070
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4071
    "Created: / 06-01-2012 / 13:05:14 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4072
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4073
11591
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4074
lineEndConvention: aSymbol
15208
c02c92b1c524 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15189
diff changeset
  4075
    self lineEndConventionHolder value: aSymbol asSymbol
11591
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4076
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4077
    "Created: / 11-07-2012 / 19:51:58 / cg"
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4078
!
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4079
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4080
lineEndConventionHolder
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4081
    ^ self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4082
        aspectFor:#lineEndConventionHolder 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4083
        ifAbsent:[
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4084
            self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4085
                applicationNamed:#FileApplicationNoteBook
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4086
                ifPresentDo:[:appl | appl lineEndConventionHolder].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4087
        ]
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4088
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4089
    "Created: / 06-01-2012 / 13:02:51 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4090
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4091
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4092
lockFileEncoding:aBoolean
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4093
    self lockFileEncodingHolder value:aBoolean.
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4094
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4095
    self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4096
        applicationNamed:#FileApplicationNoteBook
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4097
        ifPresentDo:[:nb | 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4098
            |appl|
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4099
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4100
            appl := nb selectedApplication.
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4101
            (appl notNil and:[appl isTextEditor]) ifTrue:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4102
                appl lockFileEncoding:aBoolean
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4103
            ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4104
        ].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4105
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4106
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4107
lockFileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4108
    ^ self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4109
        aspectFor:#lockFileEncodingHolder 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4110
        ifAbsent:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4111
            self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4112
                applicationNamed:#FileApplicationNoteBook
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4113
                ifPresentDo:[:appl | appl lockFileEncodingHolder].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4114
        ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4115
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4116
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4117
makeCommandHolder
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4118
    ^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4119
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4120
    "Created: / 13-04-2012 / 17:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4121
!
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4122
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4123
notify:aString
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4124
    "aString is shown in the lower pane"
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4125
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4126
    self notifyChannel value:aString
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4127
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4128
    "Modified (comment): / 11-01-2012 / 21:46:55 / cg"
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4129
!
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4130
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4131
notifyChannel
321c1729db5b initial checkin
penk
parents:
diff changeset
  4132
321c1729db5b initial checkin
penk
parents:
diff changeset
  4133
    ^ self aspectFor:#notifyChannel ifAbsent:['' asValue]
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4134
!
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4135
9575
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4136
progressPercentageHolder
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4137
    ^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ].
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4138
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4139
    "Created: / 11-10-2010 / 12:54:46 / cg"
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4140
!
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4141
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4142
rootHolder
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4143
    "holder, which keeps the rootHolder of the treeView
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4144
    "
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4145
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4146
    ^ self aspectFor:#rootHolder ifAbsent:[
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4147
        self class rootHolder asValue.
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4148
    ].
8192
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4149
!
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4150
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4151
rootHolder:aHolder
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4152
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4153
    self aspectFor:#rootHolder put:aHolder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4154
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4155
321c1729db5b initial checkin
penk
parents:
diff changeset
  4156
!AbstractFileBrowser methodsFor:'aspects handling'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4157
321c1729db5b initial checkin
penk
parents:
diff changeset
  4158
aspectFor:something ifAbsent:aBlock
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4159
    "returns the model for an aspect; these are stored in a common dictionary"
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4160
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4161
    ^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4162
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4163
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4164
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4165
    "returns the model for an aspect; these are stored in a common dictionary"
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4166
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4167
    |holder saveAspectItem aspect|
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4168
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4169
    holder := aspects at:aKey ifAbsent:[
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4170
        masterApplication notNil ifTrue:[
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4171
            holder := masterApplication aspectOrNil:aKey forSubApplication:self.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4172
        ].
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4173
        holder isNil ifTrue:[
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4174
            saveAspectItem := self runtimeAspectValueFor:aKey.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4175
            saveAspectItem notNil ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4176
                saveAspectItem isHolder ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4177
                    holder := ValueHolder with:saveAspectItem value 
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4178
                ] ifFalse:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4179
                    holder := saveAspectItem value 
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4180
                ].
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4181
            ] ifFalse:[
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4182
                aspect := self userPreferencesAspectValueFor:aKey.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4183
                aspect notNil ifTrue:[ 
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4184
                    holder := aspect asValue
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4185
                ] ifFalse:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4186
                    holder := aBlock value.
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4187
                ]
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4188
            ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4189
        ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4190
        holder notNil ifTrue:[  
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4191
            notPresentBlock notNil ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4192
                holder value:(notPresentBlock value:holder).
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4193
            ].
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4194
            aspects at:aKey put:holder
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4195
        ].
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4196
        holder
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4197
    ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4198
    ^ holder
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4199
!
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4200
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4201
aspectFor:something put:aValueHolder
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4202
    "stores the model for an aspect; these are stored in a common dictionary"
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4203
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4204
    aspects at:something put:aValueHolder
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4205
!
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4206
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4207
aspects
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4208
    "returns the common aspect dictionary"
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4209
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4210
    ^ aspects
321c1729db5b initial checkin
penk
parents:
diff changeset
  4211
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4212
321c1729db5b initial checkin
penk
parents:
diff changeset
  4213
runtimeAspectValueFor:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  4214
    "returns the default aspect item from the class variable RuntimeAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
  4215
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4216
    ^ self class runtimeAspects at:something ifAbsent:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4217
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4218
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4219
saveAspectValues
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4220
    |prefs saveAspects aspectValue|
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4221
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4222
    prefs := UserPreferences current.
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4223
    
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4224
    saveAspects := self class userPreferencesAspectList keys.
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4225
    saveAspects do:[ :aspectKey |
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4226
        aspectValue := (self perform:aspectKey) value.
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4227
        prefs 
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4228
            at: ('fileBrowser_',aspectKey asString) asSymbol 
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4229
            put: aspectValue.
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4230
    ].
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4231
    prefs beModified.
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4232
    
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4233
    "Modified: / 04-09-2006 / 10:02:41 / cg"
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4234
!
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4235
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4236
saveRuntimeAspectValues
321c1729db5b initial checkin
penk
parents:
diff changeset
  4237
    |savedAspects dictionary value isHolder aspect|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4238
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4239
    savedAspects := self class listOfRuntimeValuesToRemember.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4240
    dictionary := Dictionary new.
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4241
    savedAspects do:[:aspectKey | 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4242
        aspect := self perform:aspectKey.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4243
        isHolder := aspect isValueModel.
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4244
        isHolder ifTrue:[
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4245
            value := aspect value
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4246
        ] ifFalse:[
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4247
            value := aspect
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4248
        ].
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4249
        dictionary at:aspectKey
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4250
            put:(SaveAspectItem withValue:value isHolder:isHolder)
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4251
    ].
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4252
    RuntimeAspects := dictionary.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4253
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4254
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4255
userPreferencesAspectValueFor:something
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4256
    "returns the default aspect from the Userpreferences
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4257
    "
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4258
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4259
    (self class userPreferencesAspectList includesKey:something) ifFalse:[ ^ nil].
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4260
    ^ UserPreferences current 
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4261
        at:('fileBrowser_',something) asSymbol
9579
7107f49e4583 changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents: 9575
diff changeset
  4262
        ifAbsent:nil "(self class userPreferencesAspectList at:something)".
7107f49e4583 changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents: 9575
diff changeset
  4263
7107f49e4583 changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents: 9575
diff changeset
  4264
    "Modified: / 14-10-2010 / 19:16:38 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4265
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4266
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4267
!AbstractFileBrowser methodsFor:'aspects-filter'!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4268
9015
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4269
filter:aString
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4270
    self filterModel value:aString
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4271
!
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4272
4018
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4273
filterBackgroundColor
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4274
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4275
    ^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue]
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4276
!
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4277
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4278
filterBlockHolder
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4279
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4280
    ^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue]
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4281
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4282
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4283
filterListModel
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4284
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4285
    ^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList]
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4286
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4287
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4288
filterModel
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4289
    |m|
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4290
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4291
    m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue].
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4292
    ^ m
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4293
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4294
8185
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4295
filterModel:aHolder
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4296
    self aspectFor:#filterModel put:aHolder.
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4297
!
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4298
4018
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4299
filterValueBox
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4300
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4301
    ^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new]
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4302
!
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4303
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4304
makeFilterBlock
14497
6d95f7c8d28e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14419
diff changeset
  4305
    "return a two-arg filterblock on the file's path- and base-name. This block should return true for files
9102
6beb56becd84 changed: #makeFilterBlock
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  4306
     to be shown"
6beb56becd84 changed: #makeFilterBlock
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  4307
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4308
    | filterString filterStrings filters notFilters showHidden filterBlock caseSensitive|
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4309
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4310
    filterString := self filterModel value.
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4311
    filterString = '' ifTrue:[filterString := '*'].
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4312
    caseSensitive := "ignoreCaseInPattern ?" Filename isCaseSensitive.
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4313
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4314
    filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;.
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4315
    filterStrings := filterStrings
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4316
                select:[:eachFilter | eachFilter withoutSeparators notEmpty].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4317
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4318
    filters := filterStrings
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4319
                reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~']
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4320
                thenCollect:
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4321
                    [:eachPattern |
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4322
                        |pattern|
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4323
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4324
                        pattern := eachPattern withoutSeparators.
15597
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4325
                        pattern includesMatchCharacters ifFalse:[
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4326
                            "JV@2012-03-05: Add implict star at the beginning and at the end of pattern,
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4327
                             that's how most of the other applications behave - do what most users expect"
17772
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4328
                            "/ pattern first == $* ifFalse:[pattern := '*' , pattern].
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4329
                            "/ pattern last  == $* ifFalse:[pattern := pattern , '*'].
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4330
                            [:name :baseName | baseName asLowercase includesString:pattern caseSensitive:caseSensitive]
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4331
                        ] ifTrue:[
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4332
                            pattern = '*' ifTrue:[
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4333
                                [:name :baseName | true].
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4334
                            ] ifFalse:[    
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4335
                                [:name :baseName | pattern match:baseName caseSensitive:caseSensitive]
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4336
                            ].
15597
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4337
                        ].
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4338
                    ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4339
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4340
    notFilters := filterStrings
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4341
                select:[:eachFilter | eachFilter withoutSeparators startsWith:'~']
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4342
                thenCollect:
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4343
                    [:eachPattern |
9296
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4344
                        |pattern|
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4345
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4346
                        pattern := eachPattern withoutSeparators.
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4347
                        pattern := (pattern copyFrom:2) withoutSeparators.
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4348
                        [:name :baseName | pattern match:baseName caseSensitive:caseSensitive]
9296
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4349
                    ].
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4350
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4351
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4352
    (filters size == 1 and:[notFilters isEmpty]) ifTrue:[ 
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4353
        filterBlock := filters first 
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4354
    ] ifFalse:[
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4355
        filters isEmpty ifTrue:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4356
            filterBlock := [:name :baseName | 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4357
                               (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4358
                           ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4359
        ] ifFalse:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4360
            notFilters isEmpty ifTrue:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4361
                filterBlock := [:name :baseName | 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4362
                                   (filters contains:[:aFilter | aFilter value:name value:baseName ])
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4363
                               ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4364
            ] ifFalse:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4365
                filterBlock := [:name :baseName | 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4366
                                   (filters contains:[:aFilter | aFilter value:name value:baseName ])
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4367
                                   and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ]
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4368
                               ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4369
            ]
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4370
        ]
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4371
    ].
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4372
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4373
    showHidden := self showHiddenFiles value.
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4374
    showHidden ifTrue:[
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4375
        ^ filterBlock.
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4376
    ].
9296
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4377
    ^ [:name :baseName | 
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4378
                name isHidden not and:[filterBlock value:name value:baseName]].
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4379
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4380
    "Modified: / 05-02-2012 / 01:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4381
    "Modified: / 27-03-2017 / 12:52:08 / stefan"
17772
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4382
    "Modified: / 20-11-2017 / 22:02:04 / cg"
4018
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4383
!
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4384
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4385
shownFiles
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4386
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4387
    ^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue]
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4388
! !
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4389
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  4390
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4391
!AbstractFileBrowser methodsFor:'aspects-history'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4392
321c1729db5b initial checkin
penk
parents:
diff changeset
  4393
dirHistory
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4394
    "obsolete"
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4395
    ^ self directoryHistory
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4396
!
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4397
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4398
directoryHistory
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  4399
    ^ self class directoryHistory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4400
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4401
321c1729db5b initial checkin
penk
parents:
diff changeset
  4402
enableBack
321c1729db5b initial checkin
penk
parents:
diff changeset
  4403
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4404
    ^ self aspectFor:#enableBack ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4405
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4406
321c1729db5b initial checkin
penk
parents:
diff changeset
  4407
enableFileHistory
321c1729db5b initial checkin
penk
parents:
diff changeset
  4408
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4409
    ^ self aspectFor:#enableFileHistory ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4410
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4411
321c1729db5b initial checkin
penk
parents:
diff changeset
  4412
enableForward
321c1729db5b initial checkin
penk
parents:
diff changeset
  4413
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4414
    ^ self aspectFor:#enableForward ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4415
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4416
321c1729db5b initial checkin
penk
parents:
diff changeset
  4417
fileHistory
9820
07b7d7929e3e variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents: 9793
diff changeset
  4418
    ^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4419
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4420
321c1729db5b initial checkin
penk
parents:
diff changeset
  4421
!AbstractFileBrowser methodsFor:'aspects-visibility'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4422
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4423
activityVisibilityChannel
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4424
    " activityVisibilityChannel switches the activity indicator on/off"
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4425
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4426
    ^ self aspectFor:#activityVisibilityChannel ifAbsent:[ ValueHolder with:false ].
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4427
!
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4428
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4429
alwaysUseSmalltalkTools
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4430
    " aspect to prevent os tools to be opened on double click"
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4431
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4432
    ^ self aspectFor:#alwaysUseSmalltalkTools ifAbsent:[ ValueHolder with:true ].
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4433
!
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4434
6602
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4435
changeSetBrowserItemVisible
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4436
    ^ Screen current ctrlDown.
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4437
!
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4438
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4439
cvsMenusAreShown
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4440
    ^ ConfigurableFeatures includesFeature: #CVSSupportEnabled
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4441
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4442
    "Created: / 15-01-2012 / 13:00:05 / cg"
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4443
    "Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4444
!
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4445
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4446
hgMenusAreShown
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4447
     ^ (ConfigurableFeatures includesFeature: #HGSupportEnabled)
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4448
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4449
    "Created: / 14-01-2013 / 11:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4450
!
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4451
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4452
mercurialMenusAreShown
11147
ce417478b309 changed:
Claus Gittinger <cg@exept.de>
parents: 11144
diff changeset
  4453
    ^ ConfigurableFeatures hasMercurialSupportEnabled
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4454
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4455
    "Created: / 15-01-2012 / 13:00:00 / cg"
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4456
!
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4457
4110
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4458
openAlwaysInTextEditor
17024
396ae901ba2f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16975
diff changeset
  4459
    " aspect for open every file in TextEditor don't use e.g. HtmlEditor for *.html'"
4110
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4460
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4461
    ^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ].
4110
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4462
!
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4463
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4464
openMultipleApplicationsForType
321c1729db5b initial checkin
penk
parents:
diff changeset
  4465
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4466
    " aspect for open more applications for e.g. TextEditor and not change the contents of already 
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4467
      open TextEditor "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4468
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4469
    ^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4470
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4471
11137
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4472
perforceMenusAreShown
11996
e3b824f2d454 changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents: 11995
diff changeset
  4473
    ^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled)
e3b824f2d454 changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents: 11995
diff changeset
  4474
    and:[ ConfigurableFeatures hasPerforceSupportEnabled ]
11137
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4475
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4476
    "Created: / 15-01-2012 / 13:12:11 / cg"
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4477
    "Modified: / 19-01-2012 / 10:43:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11996
e3b824f2d454 changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents: 11995
diff changeset
  4478
    "Modified: / 02-11-2012 / 11:19:59 / cg"
11137
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4479
!
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4480
14709
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4481
showDirectoriesOnTop
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4482
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4483
    ^ self aspectFor:#showDirectoriesOnTop ifAbsent:[ false asValue ]
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4484
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4485
    "Created: / 12-08-2014 / 13:02:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4486
!
dc6998e427f4 Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14659
diff changeset
  4487
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4488
showDirectoryTree
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4489
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4490
    ^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4491
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4492
4554
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4493
showDiskUsageHolder
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4494
    |holder|
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4495
4560
0d3db5e27bc0 default for disk usage is false
Claus Gittinger <cg@exept.de>
parents: 4558
diff changeset
  4496
    holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue].
4781
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4497
    holder addDependent:self.
4554
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4498
    ^ holder
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4499
!
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4500
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4501
showHiddenFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  4502
9582
9ae5011f5ef7 changed: #showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 9579
diff changeset
  4503
    ^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ].
9ae5011f5ef7 changed: #showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 9579
diff changeset
  4504
9ae5011f5ef7 changed: #showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 9579
diff changeset
  4505
    "Modified: / 15-10-2010 / 10:28:17 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4506
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4507
9108
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4508
showHiddenFiles:aHolder
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4509
    self aspectFor:#showHiddenFiles put:aHolder.
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4510
!
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4511
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4512
shownFiles:aHolder
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4513
    self aspectFor:#shownFiles put:aHolder.
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4514
!
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4515
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4516
svnMenusAreShown
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4517
    ^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4518
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4519
    "Created: / 15-01-2012 / 13:02:03 / cg"
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4520
    "Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4521
!
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4522
9945
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4523
tagsBrowserVisibleHolder
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4524
    masterApplication notNil ifTrue:[
11162
faf8af233ac0 changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 11156
diff changeset
  4525
        ^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false
9945
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4526
    ].
10762
311190be6490 changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 10757
diff changeset
  4527
    ^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ].
9945
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4528
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4529
    "Created: / 27-06-2011 / 16:02:59 / cg"
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4530
!
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4531
10757
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4532
useCodeView2InTools
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4533
    ^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ].
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4534
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4535
    "Created: / 06-10-2011 / 11:45:58 / cg"
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4536
!
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4537
4648
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4538
userContextAvailable
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4539
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4540
    " aspect for show group and user columns in contents view
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4541
      windows provides no user context"
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4542
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4543
    ^ OperatingSystem isMSWINDOWSlike not 
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4544
!
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4545
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4546
viewDescription
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4547
    "aspect for show file description in DirectoryContentsBrowser"
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4548
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4549
    ^ self directoryContentsBrowser viewDescription
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4550
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4551
321c1729db5b initial checkin
penk
parents:
diff changeset
  4552
viewDetails
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4553
    "aspect for show more file properties in DirectoryContentsBrowser 
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4554
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4555
6121
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4556
    |directoryContentsBrowser|
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4557
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4558
    directoryContentsBrowser := self directoryContentsBrowser.
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4559
    directoryContentsBrowser isNil ifTrue:[^ nil].    
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4560
    ^ directoryContentsBrowser viewDetails
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4561
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4562
321c1729db5b initial checkin
penk
parents:
diff changeset
  4563
viewDirectoryDescription
321c1729db5b initial checkin
penk
parents:
diff changeset
  4564
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4565
    " aspect for auto open a TextView for Readme and other see getInfoItem Method files 
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4566
      on change directory "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4567
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4568
    ^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4569
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4570
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4571
viewDirsInContentsBrowser
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4572
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4573
    ^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ].
9319
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4574
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4575
    "
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4576
     UserPreferences current viewDirsInContentsBrowser
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4577
    "
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4578
!
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4579
5870
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4580
viewFilesInContentsBrowser
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4581
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4582
    ^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ].
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4583
!
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4584
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4585
viewFilesInDirectoryTree
321c1729db5b initial checkin
penk
parents:
diff changeset
  4586
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4587
    " aspect for view files in tree view (not only directories) "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4588
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4589
    ^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4590
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4591
321c1729db5b initial checkin
penk
parents:
diff changeset
  4592
viewGroup
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4593
    " aspect for show group information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4594
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4595
    ^ self directoryContentsBrowser viewGroup
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4596
!
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4597
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4598
viewIcon
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4599
    " aspect for show file-type icon in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4600
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4601
    ^ self directoryContentsBrowser viewIcon
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4602
!
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4603
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4604
viewInodeNumber
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4605
    " aspect for show inode numbers in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4606
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4607
    ^ self directoryContentsBrowser viewInodeNumber
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4608
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4609
321c1729db5b initial checkin
penk
parents:
diff changeset
  4610
viewNoteBookApplicationHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  4611
321c1729db5b initial checkin
penk
parents:
diff changeset
  4612
    ^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4613
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4614
321c1729db5b initial checkin
penk
parents:
diff changeset
  4615
viewOwner
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4616
    " aspect for show owner information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4617
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4618
    ^ self directoryContentsBrowser viewOwner
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4619
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4620
321c1729db5b initial checkin
penk
parents:
diff changeset
  4621
viewPermissions
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4622
    " aspect for show permission information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4623
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4624
    ^ self directoryContentsBrowser viewPermissions
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4625
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4626
321c1729db5b initial checkin
penk
parents:
diff changeset
  4627
viewPreview
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4628
    " aspect for show image previev in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4629
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4630
    ^ self directoryContentsBrowser viewPreview
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4631
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4632
321c1729db5b initial checkin
penk
parents:
diff changeset
  4633
viewSize
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4634
    " aspect for show size information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4635
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4636
    ^ self directoryContentsBrowser viewSize
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4637
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4638
4974
6cebe0a963e5 viewSizeInBytes
Claus Gittinger <cg@exept.de>
parents: 4973
diff changeset
  4639
viewSizeInBytes
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4640
    " aspect for show size-in-bytes information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4641
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4642
    ^ self directoryContentsBrowser viewSizeInBytes
4974
6cebe0a963e5 viewSizeInBytes
Claus Gittinger <cg@exept.de>
parents: 4973
diff changeset
  4643
!
6cebe0a963e5 viewSizeInBytes
Claus Gittinger <cg@exept.de>
parents: 4973
diff changeset
  4644
5312
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4645
viewSizeInKiloBytes
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4646
    " aspect for show size-in-kilobytes information in DirectoryContentsBrowser "
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4647
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4648
    ^ self directoryContentsBrowser viewSizeInKiloBytes
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4649
!
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4650
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4651
viewTime
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4652
    " aspect for show time information in DirectoryContentsBrowser"
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4653
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4654
    ^ self directoryContentsBrowser viewTime
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4655
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4656
321c1729db5b initial checkin
penk
parents:
diff changeset
  4657
viewType
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4658
    " aspect for show suffix (type) information in DirectoryContentsBrowser"
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4659
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4660
    ^ self directoryContentsBrowser viewType
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4661
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4662
321c1729db5b initial checkin
penk
parents:
diff changeset
  4663
!AbstractFileBrowser methodsFor:'background processing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4664
321c1729db5b initial checkin
penk
parents:
diff changeset
  4665
executeCommand:cmd
321c1729db5b initial checkin
penk
parents:
diff changeset
  4666
321c1729db5b initial checkin
penk
parents:
diff changeset
  4667
    self executeCommand:cmd inDirectory:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4668
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4669
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4670
executeCommand:cmd inDirectory:aDirectoryOrNil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4671
    | nameString executionBlock|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4672
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4673
    executionBlock := self getExecutionBlockForCommand:cmd inDirectory:aDirectoryOrNil.
4516
dc3b7a89598a close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents: 4496
diff changeset
  4674
    nameString := 'Execute: ', cmd.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4675
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4676
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4677
321c1729db5b initial checkin
penk
parents:
diff changeset
  4678
getExecutionBlockForCommand:cmd
321c1729db5b initial checkin
penk
parents:
diff changeset
  4679
321c1729db5b initial checkin
penk
parents:
diff changeset
  4680
    ^ self getExecutionBlockForCommand:cmd inDirectory:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4681
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4682
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4683
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4684
    | dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4685
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4686
    dir := directoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4687
    directoryOrNil isNil ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4688
        dir := self theSingleSelectedDirectoryOrNil.
6671
f76b43f3b0ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6652
diff changeset
  4689
        dir isNil ifTrue:[ 
12493
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  4690
            Dialog warn:(resources string:'Please select a single directory.').
16732
f2b590b8d7f8 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16721
diff changeset
  4691
            AbortOperationRequest raise.
6671
f76b43f3b0ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6652
diff changeset
  4692
            ^ nil
f76b43f3b0ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6652
diff changeset
  4693
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4694
    ].
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4695
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4696
    ^ [:stream| 
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4697
        stream notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4698
            OperatingSystem 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4699
                executeCommand:cmd
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4700
                inputFrom:nil 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4701
                outputTo:stream 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4702
                errorTo:stream 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4703
                inDirectory:dir
16732
f2b590b8d7f8 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16721
diff changeset
  4704
                lineWise:true
16825
b5bc034a38d7 #BUGFIX by sr
sr
parents: 16778
diff changeset
  4705
                showWindow:false
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4706
                onError:[:status| false].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4707
        ]
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4708
      ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4709
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4710
321c1729db5b initial checkin
penk
parents:
diff changeset
  4711
killAllRunningBackgroundProcesses
321c1729db5b initial checkin
penk
parents:
diff changeset
  4712
321c1729db5b initial checkin
penk
parents:
diff changeset
  4713
    self backgroundProcesses do:[ : process |
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4714
        self notify:'kill ', process name.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4715
        process terminate.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4716
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4717
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4718
321c1729db5b initial checkin
penk
parents:
diff changeset
  4719
makeExecutionResultProcessFor:aBlock withName:aString
321c1729db5b initial checkin
penk
parents:
diff changeset
  4720
    | stream process appl nameString|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4721
321c1729db5b initial checkin
penk
parents:
diff changeset
  4722
    appl := self openCommandResultApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4723
    stream := appl resultStream.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4724
    nameString := aString ? 'Execution Result'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4725
    appl changeTabTo:nameString.
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4726
16102
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4727
    process := 
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4728
        [ 
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4729
            [aBlock value:stream] 
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4730
            ensure:[
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4731
                self backgroundProcesses remove:process ifAbsent:[].
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4732
                appl process value:nil.
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4733
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4734
                "/ close automatically, if there was no output.
4571
35e2bf331bdc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  4735
"/                        appl resultStream contents isEmpty ifTrue:[
35e2bf331bdc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  4736
"/                            appl doClose.
35e2bf331bdc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  4737
"/                        ]
16102
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4738
                stream nextPutLine:'Done.'.
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4739
                self enqueueMessage:#updateCurrentDirectory.
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4740
            ]
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4741
        ] newProcess.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4742
    process priority:(Processor userBackgroundPriority).
321c1729db5b initial checkin
penk
parents:
diff changeset
  4743
    process name:nameString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4744
    self backgroundProcesses add:process.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4745
    appl process value:process.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4746
    process resume.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4747
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4748
321c1729db5b initial checkin
penk
parents:
diff changeset
  4749
!AbstractFileBrowser methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4750
4915
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4751
currentFileNameHolderChanged
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4752
    "/ self currentFileNameHolderChangedForCommon
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4753
!
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4754
4577
52c443045ead *** empty log message ***
penk
parents: 4571
diff changeset
  4755
currentFileNameHolderChangedForCommon
5476
da16d0662a37 refactoring
penk
parents: 5439
diff changeset
  4756
    |newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty|
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4757
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4758
    selection := self currentSelectedObjects.
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4759
    self class currentSelection:selection.
4734
082a31e3bd9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  4760
13521
18393b16599b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13439
diff changeset
  4761
    selectionNotEmpty := selection notEmptyOrNil.
5476
da16d0662a37 refactoring
penk
parents: 5439
diff changeset
  4762
    self hasSelection value:selectionNotEmpty.
da16d0662a37 refactoring
penk
parents: 5439
diff changeset
  4763
    self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]).
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  4764
    self canOpenChangeBrowser value:(selectionNotEmpty).
4734
082a31e3bd9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  4765
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4766
    newDirectories := self directoriesForFiles:selection.
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  4767
    oldDirectories := self currentSelectedDirectories.
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4768
    oldDirectories ~= newDirectories ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4769
        self currentDirectories value:newDirectories.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4770
        size := newDirectories size.
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  4771
        rootInTreeView := self 
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  4772
                            applicationNamed:#DirectoryTreeBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  4773
                            ifPresentDo:[:appl | appl rootHolder].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  4774
        rootInTreeView := rootInTreeView value.
5437
3556b0348494 directory up not allowed for drive root under windows
penk
parents: 5432
diff changeset
  4775
        self enableDirectoryUp value:(((size == 1) and:[newDirectories first isRootDirectory not]) "or:[(rootInTreeView notNil and:[rootInTreeView value asFilename isRootDirectory not])]").
3556b0348494 directory up not allowed for drive root under windows
penk
parents: 5432
diff changeset
  4776
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4777
        newDirectories notEmpty ifTrue:[
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4778
            self directoryHistory addToHistory:(newDirectories first asString).
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4779
        ].
5074
233f4a2e3cd1 defaultDir button enabling
Claus Gittinger <cg@exept.de>
parents: 5056
diff changeset
  4780
        self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not).
14308
192c81c86815 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14298
diff changeset
  4781
        "/ self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not).
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  4782
        self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not).
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  4783
        self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not).
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4784
        self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not).
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  4785
        self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not).
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4786
    ].
9599
6ffff091db22 changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents: 9596
diff changeset
  4787
    self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]).
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4788
    self enableMakeCurrentDirectory value:(newDirectories size == 1
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4789
                                           and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]).
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  4790
    self enableForward value:self canForward.
4734
082a31e3bd9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  4791
    self enableBack    value:self canBackward.
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4792
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4793
    self updateCanMake.
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4794
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  4795
    "Modified: / 29-12-2010 / 11:01:52 / cg"
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4796
    "Modified: / 17-12-2013 / 08:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  4797
    "Modified: / 30-06-2018 / 18:30:44 / Claus Gittinger"
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4798
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4799
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4800
filterModelChanged
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4801
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4802
    self filterBlockHolder value:(self makeFilterBlock).
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4803
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4804
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4805
update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  4806
321c1729db5b initial checkin
penk
parents:
diff changeset
  4807
    " do here all the things that have to be done for every part of the FileBrowserV2
321c1729db5b initial checkin
penk
parents:
diff changeset
  4808
      and the things that have to be done if it runs standalone "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4809
321c1729db5b initial checkin
penk
parents:
diff changeset
  4810
    changedObject == self currentFileNameHolder ifTrue:[
4577
52c443045ead *** empty log message ***
penk
parents: 4571
diff changeset
  4811
        self currentFileNameHolderChangedForCommon.
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4812
        ^ self
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4813
    ].
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  4814
    changedObject == self sortCaseless ifTrue:[
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4815
        self sortFileListsBy:#baseName withReverse:false.
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4816
        ^ self
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  4817
    ].             
6785
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4818
    changedObject == self sortBlockProperty ifTrue:[
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4819
        self currentSortOrder value at:#reverse put:false.
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4820
        ^ self
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4821
    ].             
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4822
    (changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4823
        self filterModelChanged.
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4824
        ^ self
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4825
    ].
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4826
    changedObject == self rootHolder ifTrue:[
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4827
        self class rootHolder:(self rootHolder value).
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4828
        ^ self
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4829
    ].
4781
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4830
    changedObject == self showDiskUsageHolder ifTrue:[
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  4831
        self notify:nil.
4781
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4832
        ^ self
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4833
    ].
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  4834
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4835
    super update:something with:aParameter from:changedObject
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  4836
!
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  4837
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4838
updateCanMake
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4839
    |dir can|
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4840
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4841
    can := false.
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4842
    dir := self currentDirectory.
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4843
    dir notNil ifTrue:[    
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4844
        "/ Check for make
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4845
        can := (dir asFilename construct:'Makefile') exists.
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4846
        can ifFalse:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4847
            can := (dir asFilename construct:'makefile') exists.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4848
        ].
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4849
        OperatingSystem isMSWINDOWSlike ifTrue:[
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4850
            can ifFalse:[
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4851
                can := (self currentDirectory asFilename construct:'bc.mak') exists.
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4852
            ]
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4853
        ].
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4854
        can ifTrue:[ 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4855
            self makeCommandHolder value: 'make'. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4856
            self canMake value: true. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4857
            ^ self 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4858
        ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4859
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4860
        "/Check for Apache ant
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4861
        (OperatingSystem canExecuteCommand: 'ant') ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4862
            can := (dir asFilename construct:'build.xml') exists.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4863
            can ifTrue:[ 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4864
                self makeCommandHolder value: 'ant'. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4865
                self canMake value: true. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4866
                ^ self 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4867
            ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4868
        ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4869
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4870
        "/Add more here...
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4871
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4872
    ].
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4873
    self canMake value:can.
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4874
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4875
    "Modified: / 17-12-2013 / 08:13:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4876
!
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4877
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  4878
updateListAfterDelete:colOfFiles
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  4879
    self updateCurrentDirectoryWithReread
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4880
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4881
321c1729db5b initial checkin
penk
parents:
diff changeset
  4882
!AbstractFileBrowser methodsFor:'clipboard'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4883
321c1729db5b initial checkin
penk
parents:
diff changeset
  4884
canPaste
321c1729db5b initial checkin
penk
parents:
diff changeset
  4885
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4886
    ^ self aspectFor:#canPaste ifAbsent:[ ValueHolder with:false ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4887
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4888
321c1729db5b initial checkin
penk
parents:
diff changeset
  4889
clipboard
321c1729db5b initial checkin
penk
parents:
diff changeset
  4890
321c1729db5b initial checkin
penk
parents:
diff changeset
  4891
    ^ self aspectFor:#clipboard ifAbsent:[Clipboard new]
321c1729db5b initial checkin
penk
parents:
diff changeset
  4892
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4893
321c1729db5b initial checkin
penk
parents:
diff changeset
  4894
copyFilesToClipBoard:colOfFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  4895
    self putInClipBoard:colOfFiles as:#copy.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4896
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4897
321c1729db5b initial checkin
penk
parents:
diff changeset
  4898
cutFilesToClipBoard:colOfFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  4899
    "defete current selected files/directories
321c1729db5b initial checkin
penk
parents:
diff changeset
  4900
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4901
    self putInClipBoard:colOfFiles as:#cut.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4902
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4903
321c1729db5b initial checkin
penk
parents:
diff changeset
  4904
emptyClipBoard
321c1729db5b initial checkin
penk
parents:
diff changeset
  4905
321c1729db5b initial checkin
penk
parents:
diff changeset
  4906
    self clipboard files:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4907
    self canPaste value:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4908
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4909
321c1729db5b initial checkin
penk
parents:
diff changeset
  4910
putInClipBoard:colOfFiles as:aSymbol
321c1729db5b initial checkin
penk
parents:
diff changeset
  4911
    | stream clp|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4912
321c1729db5b initial checkin
penk
parents:
diff changeset
  4913
    colOfFiles isEmpty ifTrue:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4914
    clp := self clipboard.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4915
    clp files:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4916
    clp method:aSymbol.
5772
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  4917
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  4918
    stream := String writeStream.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4919
    stream nextPutAll:aSymbol asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4920
    stream nextPutAll:' <'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4921
    stream nextPutAll:colOfFiles first asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4922
    colOfFiles size > 1 ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4923
        stream nextPutAll:' ...'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4924
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4925
    stream nextPutAll:'> to clipboard'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4926
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4927
    self notify:stream contents.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4928
    clp files:colOfFiles.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4929
    self canPaste value:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4930
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4931
321c1729db5b initial checkin
penk
parents:
diff changeset
  4932
!AbstractFileBrowser methodsFor:'drag & drop'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4933
321c1729db5b initial checkin
penk
parents:
diff changeset
  4934
canDropFiles:dropedObjects for:filename 
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4935
    |filenameDirString filenameDir|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4936
321c1729db5b initial checkin
penk
parents:
diff changeset
  4937
    dropedObjects isEmpty ifTrue:[^ false].
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4938
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4939
    filenameDir := self getDirWithoutFileName:filename.
7491
7fd2af9607de bugfix - check for nil directory
ca
parents: 7408
diff changeset
  4940
    filenameDir isNil ifTrue:[^ false ].
13232
a9d07ac57e19 Use #isWritableDirectory
Stefan Vogel <sv@exept.de>
parents: 13121
diff changeset
  4941
    filenameDir isWritableDirectory ifFalse:[^ false].
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4942
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4943
    filenameDirString := filenameDir asString.
4963
7ce6eae41e33 do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
  4944
7ce6eae41e33 do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
  4945
    dropedObjects do:[:aDropObject | 
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4946
        (self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false].
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4947
"/        |dropFileName dropFileNameString physicalPathName|
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4948
"/
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4949
"/        dropFileName := aDropObject theObject.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4950
"/        dropFileNameString := dropFileName asString.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4951
"/        dropFileName isDirectory ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4952
"/            (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4953
"/                self notify:'Cannot drop a directory into one of its parent directories'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4954
"/                ^ false
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4955
"/            ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4956
"/        ] ifFalse:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4957
"/            physicalPathName := dropFileName physicalPathName.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4958
"/            (filenameDirString = dropFileName directory asString 
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4959
"/            or:[ aDropObject isFileInArchive not and:[physicalPathName notNil
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4960
"/                 and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4961
"/                self notify:'Cannot drop a file into same directory'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4962
"/                ^ false
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4963
"/            ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4964
"/        ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4965
    ].
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4966
    self notify:nil.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4967
    ^ true
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4968
!
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4969
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4970
canDropObject:aDropObject into:aDirectory
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4971
    |filenameDirString dropFileName dropFileNameString physicalPathName|
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4972
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4973
    dropFileName := aDropObject theObject.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4974
    dropFileNameString := dropFileName asString.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4975
    dropFileName isDirectory ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4976
        filenameDirString := aDirectory asString.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4977
        (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4978
            self notify:'Cannot drop a directory into one of its parent directories'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4979
            ^ false
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4980
        ]
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4981
    ] ifFalse:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4982
        physicalPathName := dropFileName physicalPathName.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4983
        (aDirectory = dropFileName directory 
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4984
        or:[ aDropObject isFileInArchive not 
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4985
             and:[physicalPathName notNil
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4986
             and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4987
            self notify:'Cannot drop a file into same directory'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4988
            ^ false
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4989
        ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4990
    ].
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4991
    ^ true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4992
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4993
7406
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  4994
canDropObjects:aCollectionOfDropObjects in:aWidget
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  4995
    ^ aCollectionOfDropObjects contains:#isFileObject
7406
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  4996
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  4997
    "Created: / 13-10-2006 / 15:52:49 / cg"
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  4998
!
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  4999
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
  5000
doStartDrag:arg1 in:arg2
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
  5001
    ^ self class doStartDrag:arg1 in:arg2
6479
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5002
!
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5003
7408
028111416d25 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7406
diff changeset
  5004
dropObjects:aCollectionOfDropObjects in:aWidget at:position
7990
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5005
    |fileEntryFieldHolder destDir dropObject fn d|
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5006
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5007
    fileEntryFieldHolder := self masterApplication notNil 
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5008
                              ifTrue:[ self masterApplication fileEntryFieldHolder ]
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5009
                              ifFalse:[ self fileEntryFieldHolder ].
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5010
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5011
    aWidget model == fileEntryFieldHolder ifTrue:[
7900
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5012
        dropObject := aCollectionOfDropObjects first.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5013
        dropObject isFileObject ifTrue:[
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5014
            fn := dropObject theObject asFilename.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5015
            dropObject isDirectory ifTrue:[
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5016
                d := fn.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5017
            ] ifFalse:[
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5018
                d := fn directory.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5019
            ].
7990
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5020
            fileEntryFieldHolder value:d pathName.
7900
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5021
        ].
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5022
        ^ self.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5023
    ].
6479
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5024
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5025
    destDir := self currentDirectory.
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5026
    destDir isNil ifTrue:[^ self].
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5027
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5028
    self withWaitCursorDo:[
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5029
        aCollectionOfDropObjects do:[:dropObject |
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5030
            |fn|
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5031
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5032
            dropObject isFileObject ifTrue:[
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5033
                fn := dropObject theObject asFilename.
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5034
                dropObject isDirectory ifTrue:[
8808
cb6476c0cd3a oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
  5035
                    fn recursiveCopyTo:destDir
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5036
                ] ifFalse:[
8950
48c69259d82d changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 8887
diff changeset
  5037
                    fn copyTo:(destDir / fn baseName )
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5038
                ]
6479
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5039
            ]
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5040
        ].
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5041
    ].
9268
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5042
    self directoryContentsBrowser notNil ifTrue:[
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5043
        self directoryContentsBrowser 
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5044
            directoryContentsChangeFlag:true;
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5045
            wakeUp
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5046
    ].
7408
028111416d25 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7406
diff changeset
  5047
028111416d25 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7406
diff changeset
  5048
    "Created: / 13-10-2006 / 18:26:41 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5049
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5050
321c1729db5b initial checkin
penk
parents:
diff changeset
  5051
!AbstractFileBrowser methodsFor:'file operations'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5052
321c1729db5b initial checkin
penk
parents:
diff changeset
  5053
copyFile:aSourceFile to:aDestFile
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5054
    "copy to"
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5055
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5056
    ^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5057
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5058
    "Modified: / 07-02-2007 / 18:46:44 / cg"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5059
!
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5060
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5061
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5062
    "copy to"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5063
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5064
    |copyOperation msg|
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5065
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5066
    repairCorruptedFiles ifTrue:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5067
        copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5068
    ] ifFalse:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5069
        copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5070
    ].
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5071
    copyOperation result ifTrue:[
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5072
        msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5073
    ] ifFalse:[
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5074
        msg := copyOperation errorString.
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5075
    ].
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5076
    self notify:msg.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5077
    ^ copyOperation result
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5078
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5079
    "Created: / 07-02-2007 / 18:46:34 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5080
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5081
321c1729db5b initial checkin
penk
parents:
diff changeset
  5082
copyFiles:aColOfSourceFiles to:aDirectory 
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5083
    |copy result|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5084
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5085
    self withActivityIndicationDo:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5086
        copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory.
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5087
        copy result ifTrue:[
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5088
            result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles).
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5089
        ] ifFalse:[
4629
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5090
            self notify:copy errorString.
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5091
        ].
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5092
        self updateCurrentDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5093
    ].
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5094
    ^ result
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5095
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5096
    "Modified: / 25-07-2006 / 09:07:04 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5097
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5098
15569
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5099
copyFromToRepairingCorruptedFiles
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5100
    "ask for source and destination and copy the entered file.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5101
     Especially useful for raw devices to copy corrupted disks/files
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5102
    "
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5103
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5104
    |source destination|
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5105
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5106
    source := Dialog 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5107
                    requestDirectoryName:(resources string:'Copy from:') 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5108
                    default:(LastMoveDestination ? self currentDirectory)
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5109
                    ok:(resources string:'Continue')
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5110
                    abort:nil.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5111
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5112
    source isEmptyOrNil ifTrue:[^ self].
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5113
    source := source asFilename.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5114
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5115
    destination := Dialog 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5116
                    requestDirectoryName:(resources string:'Copy "%1" to:' with:source) 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5117
                    default:(LastMoveDestination ? self currentDirectory)
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5118
                    ok:(resources string:'Copy')
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5119
                    abort:nil.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5120
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5121
    destination isEmptyOrNil ifTrue:[^ self].
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5122
    destination := destination asFilename.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5123
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5124
    self copyFile:source to:destination repairCorruptedFiles:true.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5125
!
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5126
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5127
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory
12850
baaea91f1adc Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 12824
diff changeset
  5128
    |size msg answer file|
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5129
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5130
    size := aCollectionOfFiles size.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5131
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5132
"/    stream := WriteStream on:'' asText.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5133
"/    stream nextPutAll:'Copy or move'; cr; cr; nextPutAll:'file'.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5134
"/    size == 1 ifFalse:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5135
"/        stream nextPutAll:'s'.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5136
"/    ].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5137
"/    stream nextPutAll:': '.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5138
"/    stream nextPutAll:aCollectionOfFiles first baseName asString allBold.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5139
"/    size == 1 ifFalse:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5140
"/        stream nextPutAll:' ... '.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5141
"/        stream nextPutAll:aCollectionOfFiles last baseName asString.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5142
"/    ].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5143
"/    stream cr; nextPutAll:'to: '.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5144
"/    stream nextPutAll:aDestinationDirectory asFilename pathName allBold.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5145
"/    msg := stream contents
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5146
    size == 1 ifTrue:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5147
        file := aCollectionOfFiles first.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5148
        msg := resources    
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5149
                stringWithCRs:'Copy or move\\%1:\    %2\to:\    %3 ?'
17762
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5150
                with:(resources string:
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5151
                        (file type == #regular 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5152
                            ifTrue:'file' 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5153
                            ifFalse:[
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5154
                                file isDirectory 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5155
                                    ifTrue:'directory' 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5156
                                    ifFalse:'object']))
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5157
                with:(file baseName allBold)
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5158
                with:(aDestinationDirectory asFilename pathName allBold).
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5159
    ] ifFalse:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5160
        msg := resources    
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5161
                stringWithCRs:'Copy or move\\    %1 objects\to:\    %2 ?'
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5162
                with:size
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5163
                with:(aDestinationDirectory asFilename pathName allBold).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5164
    ].
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5165
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5166
    answer := OptionBox 
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5167
                  request:msg 
8127
116f25bc97ad national strings
Claus Gittinger <cg@exept.de>
parents: 8093
diff changeset
  5168
                  label:(resources string:'Copy or Move')
5898
f6214812e1d2 dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents: 5888
diff changeset
  5169
                  image:(WarningBox iconBitmap)
8127
116f25bc97ad national strings
Claus Gittinger <cg@exept.de>
parents: 8093
diff changeset
  5170
                  buttonLabels:(resources array:#('Cancel' 'Move' 'Copy' 'Copy As...'))
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5171
                  values:#(#cancel #move #copy #copyAs)
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5172
                  default:#copy.
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5173
    answer isNil ifTrue:[answer := #cancel].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5174
    ^ answer.
17762
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5175
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5176
    "Modified: / 17-11-2017 / 13:16:42 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5177
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5178
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5179
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory 
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5180
    "copy or move aColOfSourceFiles to aDirectory.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5181
     Asks the used if a move or a copy is wanted.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5182
     Returns true if the copyOrMove happened, false if user aborted the operation."
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5183
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5184
    |answer lastOld lastNew|
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5185
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5186
    answer := self copyOrMoveDialog:aColOfSourceFiles for:aDestinationDirectory.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5187
    answer == #copyAs ifTrue:[
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5188
        aColOfSourceFiles do:[:eachSourceFile |
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5189
            |initial destFile srcBase dstBase|
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5190
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5191
            srcBase := eachSourceFile asFilename baseName.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5192
            lastOld isNil ifTrue:[
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5193
                initial := srcBase
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5194
            ] ifFalse:[
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5195
                initial := DoWhatIMeanSupport
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5196
                            goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5197
            ].
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5198
            dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial.
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5199
            dstBase isNil ifTrue:[^ false].
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5200
            self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase).
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5201
            lastOld := srcBase.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5202
            lastNew := dstBase.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5203
        ].
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5204
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5205
        ^ true.
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5206
    ].
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5207
    answer == #copy ifTrue:[
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5208
        self copyFiles:aColOfSourceFiles to:aDestinationDirectory.
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5209
        ^ true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5210
    ].
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5211
    answer == #move ifTrue:[
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5212
        self moveFiles:aColOfSourceFiles to:aDestinationDirectory.
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5213
        ^ true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5214
    ].
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5215
    ^ false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5216
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5217
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5218
copySelectionTo
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5219
    "copy the selected file(s) to another directory"
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5220
13704
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5221
    self copySelectionToRepairingCorruptedFiles:false.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5222
    self updateCurrentDirectoryWithReread.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5223
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5224
    "Modified: / 07-02-2007 / 18:42:48 / cg"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5225
!
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5226
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5227
copySelectionToRepairingCorruptedFiles
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5228
    "copy the selected file(s) to another directory"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5229
13704
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5230
    self copySelectionToRepairingCorruptedFiles:true.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5231
    self updateCurrentDirectoryWithReread.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5232
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5233
    "Created: / 07-02-2007 / 18:42:59 / cg"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5234
!
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5235
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5236
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5237
    "copy the selected file(s) to another directory"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5238
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5239
    |selectedFiles msg destination directory|
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5240
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5241
    selectedFiles := self currentSelectedObjects copy.
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5242
    selectedFiles isEmptyOrNil ifTrue:[^ self].
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5243
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5244
    msg := (selectedFiles size > 1) 
14588
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5245
                ifTrue:[ 'Copy Selected Items to Directory:' ]
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5246
                ifFalse:[ 'Copy "%1" to Directory:' ].
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5247
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5248
    destination := Dialog 
14588
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5249
                    requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first baseName) 
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5250
                    default:(LastMoveDestination ? self currentDirectory)
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5251
                    ok:(resources string:'Copy')
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5252
                    abort:nil.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5253
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5254
    destination isEmptyOrNil ifTrue:[^ self].
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5255
    destination := destination asFilename.
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5256
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5257
    destination isDirectory ifFalse:[
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5258
        selectedFiles size == 1 ifTrue:[
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5259
            directory := destination directory.
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5260
            directory isDirectory ifTrue:[
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5261
                LastMoveDestination := directory.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5262
                self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles.
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5263
                ^ self.
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5264
            ]
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5265
        ]
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5266
    ].
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5267
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5268
    LastMoveDestination := destination.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5269
    repairingCorruptedFiles ifTrue:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5270
        selectedFiles do:[:eachFile |    
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5271
            self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5272
        ].
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5273
        ^ self.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5274
    ] ifFalse:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5275
        self copyFiles:selectedFiles to:destination
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5276
    ]
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5277
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5278
    "Created: / 07-02-2007 / 18:42:35 / cg"
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5279
!
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5280
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5281
deleteFile:aFile
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5282
    "delete the selected files/directories"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5283
321c1729db5b initial checkin
penk
parents:
diff changeset
  5284
    ^ self deleteFiles:(OrderedCollection with:aFile).
321c1729db5b initial checkin
penk
parents:
diff changeset
  5285
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5286
321c1729db5b initial checkin
penk
parents:
diff changeset
  5287
deleteFiles:colOfFiles
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5288
    "delete some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5289
5081
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5290
    ^ self deleteFiles:colOfFiles confirm:true.
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5291
!
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5292
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5293
deleteFiles:colOfFiles confirm:confirm
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5294
    "delete some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5295
5673
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5296
    |delete result|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5297
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5298
    self withActivityIndicationDo:[
9575
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5299
        ProgressNotification handle:[:info |
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5300
            self progressPercentageHolder value:info progressValue.
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5301
            info proceed
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5302
        ] do:[
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5303
            delete := FileOperation deleteFiles:colOfFiles confirm:confirm.
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5304
            result := delete result.
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5305
        ].
5673
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5306
        result notNil ifTrue:[
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5307
            result ifFalse:[
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5308
                self notify:delete errorString.
5753
e5229b5882b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
  5309
            ] ifTrue:[
e5229b5882b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
  5310
                self updateListAfterDelete:colOfFiles.
e5229b5882b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
  5311
            ]
4394
a7fedd485b73 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
  5312
        ].
5673
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5313
    ].
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5314
    ^ result.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5315
9575
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5316
    "Modified: / 11-10-2010 / 13:08:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5317
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5318
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5319
eraseFiles:colOfFiles
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5320
    "erase (clear and delete) some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5321
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5322
    ^ self eraseFiles:colOfFiles confirm:true.
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5323
!
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5324
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5325
eraseFiles:colOfFiles confirm:confirm
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5326
    "erase (clear and delete) some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5327
8462
a5d12742a900 changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents: 8454
diff changeset
  5328
    |deleteOperation result fileSize|
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5329
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5330
    self withActivityIndicationDo:[
8462
a5d12742a900 changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents: 8454
diff changeset
  5331
        fileSize := colOfFiles first asFilename fileSize.
8294
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5332
        deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm.
8462
a5d12742a900 changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents: 8454
diff changeset
  5333
        (colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ])
8294
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5334
        ifTrue:[
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5335
            result := deleteOperation result.
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5336
        ] ifFalse:[
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5337
            ProgressIndicator
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5338
                displayProgressNotifications:'Erasing' 
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5339
                abortable:true 
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5340
                at:nil 
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5341
                during:[
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5342
                    result := deleteOperation result.
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5343
                ].
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5344
        ].
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5345
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5346
        result notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5347
            result ifFalse:[
8294
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5348
                self notify:deleteOperation errorString.
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5349
            ] ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5350
                self updateListAfterDelete:colOfFiles.
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5351
            ]
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5352
        ].
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5353
    ].
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5354
    ^ result.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5355
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5356
    "Modified: / 25-07-2006 / 09:07:16 / cg"
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5357
!
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5358
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5359
moveFile:aSourceFile to:aDestFile
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5360
    "move a file/directory"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5361
321c1729db5b initial checkin
penk
parents:
diff changeset
  5362
    |move|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5363
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5364
    move := FileOperation moveFile:aSourceFile to:aDestFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5365
    move result ifTrue:[
15346
1220ca6a9666 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15259
diff changeset
  5366
        self notify:(resources string: 'move "%1" to "%2"' with:aSourceFile asString with:aDestFile asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5367
    ] ifFalse:[
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  5368
        self notify:move errorString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5369
    ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5370
    self updateCurrentDirectoryWithReread.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5371
    ^ move result
321c1729db5b initial checkin
penk
parents:
diff changeset
  5372
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5373
321c1729db5b initial checkin
penk
parents:
diff changeset
  5374
moveFiles:aColOfSourceFiles to:aDirectory 
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5375
   "move some files to aDirectory"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5376
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5377
    |move|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5378
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5379
    self withActivityIndicationDo:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5380
        move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory.
4629
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5381
        move result ifFalse:[
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5382
            self notify:move errorString.
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5383
        ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5384
        self updateCurrentDirectoryWithReread.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5385
    ].
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5386
    ^ move collectionOfMovedFiles
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5387
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5388
    "Modified: / 25-07-2006 / 09:07:32 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5389
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5390
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5391
moveSelectionTo
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5392
    "move the selected file(s) to another directory"
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5393
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5394
    |destinationDirectory|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5395
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5396
    destinationDirectory := Dialog 
14588
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5397
                                requestDirectoryName:(resources stringWithCRs:'Move Selected Items to Directory:') 
5789
b357cb31cc87 move fix
Claus Gittinger <cg@exept.de>
parents: 5778
diff changeset
  5398
                                default:(LastMoveDestination ? self currentDirectory)
6952
f9bef0205d36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6919
diff changeset
  5399
                                ok:(resources string:'Move')
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5400
                                abort:nil.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5401
    destinationDirectory isEmptyOrNil ifTrue:[^ self].
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5402
5789
b357cb31cc87 move fix
Claus Gittinger <cg@exept.de>
parents: 5778
diff changeset
  5403
    LastMoveDestination := destinationDirectory.
13704
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5404
    self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5405
    self updateCurrentDirectoryWithReread.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5406
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5407
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5408
    "Modified: / 04-12-2006 / 13:15:12 / cg"
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5409
!
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5410
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5411
newDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  5412
    "ask for and create a new directory"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5413
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5414
    |selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5415
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5416
    directory := self currentDirectory.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5417
    directory isNil ifTrue:[
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5418
        self warn:'Select a single directory to create a directory' translate:true.
4979
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5419
        ^ self
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5420
    ].
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5421
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5422
    "/ clever default if selection is an archive...
4979
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5423
    selectedFiles := self currentSelectedFiles.
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5424
    selectedFiles size == 1 ifTrue:[
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5425
        singleSelectedFile := selectedFiles first.
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5426
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5427
        mime := MIMETypes mimeTypeForFilename:singleSelectedFile.
13714
d5583c9b5ddb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13704
diff changeset
  5428
        (mime notNil and:[mime isArchiveType]) ifTrue:[
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5429
            defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName.
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5430
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5431
            mime := MIMETypes mimeTypeForFilename:defaultAnswer.
13714
d5583c9b5ddb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13704
diff changeset
  5432
            (mime notNil and:[mime isArchiveType]) ifTrue:[
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5433
                defaultAnswer := defaultAnswer asFilename withoutSuffix baseName
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5434
            ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5435
        ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5436
    ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5437
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5438
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5439
    defaultAnswer notNil ifTrue:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5440
        createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer.
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5441
    ] ifFalse:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5442
        createOp := FileOperation createDirectoryIn:directory.
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5443
    ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5444
    createOp result ifFalse:[ ^ self].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5445
    newFile := createOp createdFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5446
    newFile notNil ifTrue:[
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5447
        self updateCurrentDirectoryWithReread.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5448
    ]
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5449
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5450
    "Modified: / 29-11-2017 / 12:26:41 / cg"
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5451
    "Modified: / 01-06-2018 / 12:49:43 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5452
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5453
321c1729db5b initial checkin
penk
parents:
diff changeset
  5454
newFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  5455
    "ask for and create a new file"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5456
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5457
    | curFile directory create file|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5458
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5459
    directory := self currentDirectory.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5460
    directory isNil ifTrue:[
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5461
        self warn:'Select a single directory to create a file.' translate:true.
4979
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5462
        ^ self.
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5463
    ].
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5464
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  5465
    curFile := self firstSelectedFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5466
    curFile notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5467
        file := curFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5468
    ] ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5469
        file := directory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5470
    ].
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5471
    create := FileOperation createFileIn:file.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5472
    create result ifFalse:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5473
    self updateAndSelect:(OrderedCollection with:(create createdFile)).
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5474
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5475
    "Modified: / 29-11-2017 / 12:26:51 / cg"
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5476
    "Modified: / 01-06-2018 / 12:49:50 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5477
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5478
321c1729db5b initial checkin
penk
parents:
diff changeset
  5479
newHardLink
321c1729db5b initial checkin
penk
parents:
diff changeset
  5480
    "ask for and create a hard link (unix only)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5481
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5482
    self newLink:#hard.
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5483
!
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5484
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5485
newLink:typeOfLink
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5486
    "ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5487
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5488
    | sel dir create createdFile|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5489
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5490
    sel := self currentSelectedObjects.
4979
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5491
    (sel size ~= 1) ifTrue:[
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5492
        self warn:'Select one directory to link' translate:true.
4979
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5493
        ^ self
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5494
    ].
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5495
    dir := sel first.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5496
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5497
    create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5498
    create result ifFalse:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5499
    createdFile := create createdFile.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5500
    createdFile notNil ifTrue:[
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5501
        typeOfLink == #soft ifTrue:[
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5502
            self updateCurrentDirectoryWithReread.
4785
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  5503
        ] ifFalse:[
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  5504
            self updateAndSelect:(OrderedCollection with:createdFile).
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  5505
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5506
    ].
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5507
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5508
    "Modified: / 29-11-2017 / 12:26:58 / cg"
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5509
    "Modified: / 01-06-2018 / 12:49:32 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5510
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5511
321c1729db5b initial checkin
penk
parents:
diff changeset
  5512
newSoftLink
321c1729db5b initial checkin
penk
parents:
diff changeset
  5513
    "ask for and create a soft link (unix only)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5514
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5515
    self newLink:#soft.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5516
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5517
321c1729db5b initial checkin
penk
parents:
diff changeset
  5518
pasteFiles
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5519
    "paste from clipBoard"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5520
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5521
    |buffer destination files directories copiedFiles thisIsAFileMoveOperation|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5522
321c1729db5b initial checkin
penk
parents:
diff changeset
  5523
    files := self clipboard files.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6479
diff changeset
  5524
    files isEmptyOrNil ifTrue:[ ^ self ].
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5525
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5526
    thisIsAFileMoveOperation := self clipboard method == #cut.
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5527
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5528
    buffer := self clipboard copy.
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  5529
    directories := self currentSelectedDirectories.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5530
    directories size ~~ 1 ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5531
        |box dirStringCol|
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5532
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5533
        dirStringCol := directories collect:[:aDir| aDir asString].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5534
        box := ListSelectionBox new.
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5535
        box title:'Paste into which directory ?'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5536
        box list:dirStringCol.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5537
        box okAction:[:sel | destination := sel asFilename].
5003
a14ce263ada5 boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents: 4982
diff changeset
  5538
        box show.
a14ce263ada5 boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents: 4982
diff changeset
  5539
        box destroy.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5540
    ] ifFalse:[
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5541
        destination := directories anElement.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5542
    ].
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5543
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5544
    thisIsAFileMoveOperation ifTrue:[
5081
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5545
        buffer files copy do:[:aFile|
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5546
            aFile directory = destination ifTrue:[
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5547
                buffer files remove:aFile.
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5548
            ].
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5549
        ].
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5550
    ].
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5551
    copiedFiles := self copyFiles:(buffer files) to:destination.
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5552
    copiedFiles notEmptyOrNil ifTrue:[    
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5553
        thisIsAFileMoveOperation ifTrue:[
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5554
            self deleteFiles:(copiedFiles keys) confirm:false.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5555
        ]. 
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5556
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5557
        "/ select those pasted files.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5558
        self updateCurrentDirectory:true.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5559
        self currentFileNameHolder value:copiedFiles values.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5560
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5561
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5562
321c1729db5b initial checkin
penk
parents:
diff changeset
  5563
renameFile:aFile 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5564
    "rename the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5565
9793
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5566
    ^ self renameFiles:(Array with:aFile).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5567
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5568
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5569
renameFile:filename to:newFileString update:aBoolean
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5570
    "rename filename to newFileString"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5571
321c1729db5b initial checkin
penk
parents:
diff changeset
  5572
    |rename|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5573
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5574
    rename := FileOperation renameFile:filename to:newFileString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5575
    rename result ifTrue:[
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5576
        aBoolean ifTrue:[
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5577
            self updateAndSelect:(rename renamedFiles).
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5578
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5579
    ] ifFalse:[
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  5580
        self notify:rename errorString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5581
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5582
    ^ rename result
321c1729db5b initial checkin
penk
parents:
diff changeset
  5583
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5584
321c1729db5b initial checkin
penk
parents:
diff changeset
  5585
renameFiles:aColOfFiles 
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5586
    "rename some file(s)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5587
321c1729db5b initial checkin
penk
parents:
diff changeset
  5588
    |rename|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5589
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5590
    rename := FileOperation renameFiles:aColOfFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5591
    rename result ifFalse:[
9793
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5592
        self notify:rename errorString.
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5593
        ^ nil.
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5594
    ].
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5595
    ^ rename
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5596
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5597
321c1729db5b initial checkin
penk
parents:
diff changeset
  5598
renameSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  5599
    "rename the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5600
9793
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5601
    |renamed|
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5602
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5603
    renamed := self renameFiles:(self currentSelectedObjects copy).
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5604
    renamed notNil ifTrue:[
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5605
        self updateAndSelect:renamed renamedFiles.
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5606
    ].
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5607
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5608
    "Modified: / 04-12-2006 / 13:15:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5609
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5610
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5611
!AbstractFileBrowser methodsFor:'menu accessing'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5612
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  5613
bookmarksMenu
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5614
    <resource: #programMenu>
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5615
14941
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5616
    ^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec.
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5617
!
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5618
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5619
bookmarksMenuForBaseSpec:aBaseMenuSpec
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5620
    <resource: #programMenu>
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5621
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5622
    |menu bookmarks|
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5623
14941
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5624
    menu := aBaseMenuSpec decodeAsLiteralArray.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5625
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5626
    "/ add the bookmark items ...
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5627
    bookmarks := self class directoryBookmarks.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5628
    bookmarks notEmptyOrNil ifTrue:[
14604
8cbf91f053fa class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14593
diff changeset
  5629
        menu addSeparator.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5630
        bookmarks do:[:dirName |
12963
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5631
            menu addItem:(MenuItem 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5632
                            label:dirName asString 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5633
                            itemValue:[
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5634
                                (self currentSelectedDirectories includes:dirName) ifFalse:[
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5635
                                    self setCurrentFileName:dirName.
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5636
                                ].
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5637
                            ]).
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5638
        ].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5639
    ].
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5640
    menu findGuiResourcesIn:self.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5641
    ^ menu
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5642
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  5643
    "Modified: / 14-01-2012 / 21:14:03 / cg"
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5644
!
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5645
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5646
canBackward
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5647
    ^ self directoryHistory canBackward.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5648
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5649
    "Modified: / 27-03-2007 / 10:54:55 / cg"
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5650
!
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5651
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5652
canForward
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5653
    ^ self directoryHistory canForward.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5654
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5655
    "Modified: / 27-03-2007 / 10:54:57 / cg"
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5656
!
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5657
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  5658
gotoBookmarksMenu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5659
    <resource: #programMenu>
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5660
14941
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5661
    ^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec2.
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  5662
!
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  5663
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5664
menuDirHistory:backOrForward
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5665
    "initialize the history menu"
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5666
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5667
    <resource: #programMenu >
321c1729db5b initial checkin
penk
parents:
diff changeset
  5668
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5669
    |hist menu pathList currentSel currentPath|
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5670
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5671
    hist := self directoryHistory.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5672
    hist isEmpty ifTrue:[^ nil].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5673
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5674
    backOrForward == #back ifTrue:[
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  5675
        currentSel := self currentSelectedDirectories.
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5676
        currentSel size == 1 ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5677
            currentPath := currentSel first asString.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5678
        ] ifFalse:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5679
            currentPath := nil.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5680
        ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5681
        pathList := hist getBackCollection.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5682
    ] ifFalse:[
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5683
        pathList := hist getForwardCollection.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5684
    ].
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  5685
    pathList isEmpty ifTrue:[ ^ nil].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5686
6370
eef587af6aa5 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6369
diff changeset
  5687
    pathList size > 30 ifTrue:[
eef587af6aa5 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6369
diff changeset
  5688
        pathList := pathList copyTo:30
eef587af6aa5 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6369
diff changeset
  5689
    ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5690
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5691
    menu := Menu new.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5692
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  5693
    pathList do:[:aPath| 
14593
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5694
        menu addItem:(MenuItem
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5695
                        label:aPath
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5696
                        itemValue:[ self setCurrentFileName:(aPath asFilename) ]
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5697
                        translateLabel:false).
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5698
    ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5699
    menu findGuiResourcesIn:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5700
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5701
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5702
    "Modified: / 09-09-2012 / 13:07:22 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5703
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5704
321c1729db5b initial checkin
penk
parents:
diff changeset
  5705
menuDirHistoryBack
321c1729db5b initial checkin
penk
parents:
diff changeset
  5706
    "initialize the directory menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  5707
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  5708
    <resource: #programMenu >
321c1729db5b initial checkin
penk
parents:
diff changeset
  5709
321c1729db5b initial checkin
penk
parents:
diff changeset
  5710
    ^ self menuDirHistory:#back.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5711
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5712
321c1729db5b initial checkin
penk
parents:
diff changeset
  5713
menuDirHistoryForward
321c1729db5b initial checkin
penk
parents:
diff changeset
  5714
    "initialize the directory menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  5715
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  5716
    <resource: #programMenu >
321c1729db5b initial checkin
penk
parents:
diff changeset
  5717
321c1729db5b initial checkin
penk
parents:
diff changeset
  5718
    ^ self menuDirHistory:#forward.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5719
!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5720
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5721
menuFileHistory
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5722
    "initialize the file history menu
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5723
    "
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5724
    <resource: #programMenu >
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5725
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5726
    |menu hist text removeItem|
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5727
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5728
    hist := self fileHistory.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5729
    hist isEmpty ifTrue:[^ nil].
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5730
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5731
    menu := Menu new.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5732
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5733
    hist copy do:[:aFileItem|
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5734
        aFileItem fileName exists ifTrue:[
12963
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5735
            menu addItem:(MenuItem 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5736
                            label: aFileItem fileName asString 
14593
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5737
                            itemValue:
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5738
                                [
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5739
                                    self setCurrentFileName:(aFileItem fileName).
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5740
                                    self openApplByFileItem:aFileItem
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5741
                                ]
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5742
                            translateLabel:false).
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5743
        ] ifFalse:[
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5744
            "/ remove all not existing history entries
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5745
            hist remove:aFileItem.
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5746
        ]
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5747
    ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5748
    menu addSeparator.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5749
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5750
    removeItem := MenuItem new.
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5751
    removeItem translateLabel:true.
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5752
    text := resources string:'Clear History'.
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5753
    "/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text.
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5754
    removeItem label:text.
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5755
    removeItem 
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5756
        itemValue:[
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5757
            self fileHistory removeAll.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5758
            self enableFileHistory value:false.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5759
        ].
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5760
    menu addItem:removeItem.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5761
    menu findGuiResourcesIn:self.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5762
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5763
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5764
    "Modified (format): / 09-09-2012 / 13:07:36 / cg"
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5765
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5766
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5767
sortMenu
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5768
    <resource: #programMenu >
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5769
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5770
    |menu|
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5771
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5772
    menu :=  Menu decodeFromLiteralArray:self class sortMenu.
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5773
    menu findGuiResourcesIn:self.
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5774
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5775
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5776
    "Modified: / 27-03-2007 / 10:47:42 / cg"
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5777
!
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5778
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5779
viewDetailsMenuSpec
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5780
    |specContentsBrowser itemsContentsBrowser specHere itemsHere spec| 
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5781
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5782
    specHere := self class viewDetailsMenuSpec.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5783
    itemsHere := specHere at:2.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5784
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5785
    specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5786
    itemsContentsBrowser := (specContentsBrowser at:2).
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5787
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5788
    spec := specHere copy.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5789
    spec at:2 put:(itemsContentsBrowser , itemsHere).
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5790
    ^ spec
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5791
!
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5792
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5793
viewInContentsBrowserMenu
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5794
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5795
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5796
        ifPresentDo:[:appl | ^ appl viewBrowserMenu].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5797
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5798
    ^ nil.
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5799
!
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5800
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5801
visitedDirectoriesMenu
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5802
    <resource: #programMenu >
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5803
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5804
    |menu histCopy text removeItem|
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5805
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5806
    histCopy := self directoryHistory.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5807
    histCopy isEmpty ifTrue:[^ nil].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5808
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5809
    menu := Menu new.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5810
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5811
    histCopy do:[:aFile| 
12963
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5812
        menu addItem:(MenuItem 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5813
                        label:aFile asString 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5814
                        itemValue:[
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5815
                            self setCurrentFileName:(aFile path asFilename).
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5816
                        ]).
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5817
    ].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5818
    menu addSeparator.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5819
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5820
    "/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:(resources string:'Clear History').
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5821
    text := (resources string:'Clear History').
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5822
    removeItem := MenuItem new.
4040
c880438f2554 *** empty log message ***
penk
parents: 4034
diff changeset
  5823
    removeItem translateLabel:true.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5824
    removeItem label:text.
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5825
    removeItem 
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5826
        itemValue:[
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5827
            self directoryHistory removeAll.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5828
            self enableForward value:self canForward.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5829
            self enableBack value:self canBackward.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5830
        ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5831
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5832
    menu addItem:removeItem.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5833
    menu findGuiResourcesIn:self.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5834
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5835
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5836
    "Modified: / 09-09-2012 / 13:07:45 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5837
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5838
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5839
!AbstractFileBrowser methodsFor:'menu actions'!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5840
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5841
doCompareTwoFiles
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5842
    self openDiffView.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5843
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5844
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5845
doGoDirectoryUp
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5846
    | upDir directory rootInTreeView|
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5847
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5848
    self enableDirectoryUp value ifFalse:[ ^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5849
    self currentFilesAreInSameDirectory ifTrue:[
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5850
        directory := self currentDirectory.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5851
        directory isNil ifTrue:[ ^ self].
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5852
    ] ifFalse:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5853
        rootInTreeView := self 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5854
                            applicationNamed:#DirectoryTreeBrowser 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5855
                            ifPresentDo:[:appl | appl rootHolder].
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5856
        directory := rootInTreeView value asFilename.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5857
    ].
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5858
    upDir := directory directory.
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  5859
    self setCurrentFileName:upDir.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5860
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5861
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5862
doGotoDefaultDirectory
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5863
    self gotoFile:(Filename defaultDirectory).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5864
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5865
8091
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5866
doGotoDesktopDirectory
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5867
    self gotoFile:(Filename desktopDirectory).
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5868
!
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5869
18036
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5870
doGotoDocumentsDirectory
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5871
    self gotoFile:(Filename documentsDirectory).
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5872
!
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5873
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5874
doGotoDownloadsDirectory
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5875
    self gotoFile:(Filename downloadsDirectory).
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5876
!
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5877
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5878
doGotoHomeDirectory
8091
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5879
    self gotoFile:(Filename homeDirectory).
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5880
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5881
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5882
doGotoSmalltalkDirectory
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5883
    self gotoFile:(self smalltalkDirectory).
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5884
!
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5885
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5886
doGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5887
    self gotoFile:(UserPreferences current workspaceDirectory).
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5888
!
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5889
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5890
doGotoTempDirectory
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5891
    self gotoFile:(self tempDirectory).
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5892
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5893
    "Created: / 29-12-2010 / 11:03:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5894
!
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5895
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5896
doMakeCurrentDirectory
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5897
    <resource: #obsolete>
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5898
    
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5899
    "/ no longer
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5900
    ^ self
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5901
"/    OperatingSystem setCurrentDirectory:(self currentDirectory pathName).
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5902
"/    self currentFileNameHolderChangedForCommon.
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5903
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5904
    "Created: / 26-10-2010 / 17:21:19 / cg"
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5905
    "Modified (format): / 17-07-2017 / 10:09:39 / cg"
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5906
!
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5907
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5908
fileGetInfo:longInfo 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5909
    "get info on selected file - show it in a box"
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5910
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5911
    |string box updater|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5912
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5913
    string := self getFileInfoStringForFirstSelectedFile:longInfo.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5914
    string notNil ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5915
        box := InfoBox title:string.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5916
        updater := [
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5917
                    [true] whileTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5918
                        Delay waitForSeconds:2.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5919
                        string := self getFileInfoStringForFirstSelectedFile:longInfo.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5920
                        string isNil ifTrue:[ ^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5921
                        box title:string
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5922
                    ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5923
                ] fork.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5924
        box show.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5925
        updater terminate.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5926
        box destroy
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5927
    ]
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5928
!
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5929
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5930
showDeltaBetweenTwoImageFiles
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5931
     |i1 i2 delta|
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5932
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5933
     i1 := Image fromFile:(self selectedFileNames first).
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5934
     i2 := Image fromFile:(self selectedFileNames second).
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5935
     delta := ImageAlgorithms new differenceImageBetween:i1 and:i2.
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5936
     ImageView openOn:delta.
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5937
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5938
    "Created: / 10-09-2017 / 16:59:08 / cg"
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5939
!
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  5940
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5941
smalltalkDirectory
8590
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  5942
    |stxPath|
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5943
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5944
    stxPath := OperatingSystem pathOfSTXExecutable.
8590
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  5945
    stxPath isNil ifTrue:[
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  5946
        ^ Filename currentDirectory
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  5947
    ].
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  5948
    ^ stxPath asFilename directory.
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5949
!
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5950
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5951
tempDirectory
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5952
    ^ Filename tempDirectory.
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5953
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5954
    "Created: / 29-12-2010 / 11:03:00 / cg"
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5955
! !
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5956
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5957
!AbstractFileBrowser methodsFor:'menu actions-file'!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5958
14262
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5959
addDirToJavaSourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5960
    "add the current path to java's sourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5961
     (only available with ST/J System"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5962
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5963
    Java addToSourcePath:self currentDirectory pathName
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5964
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5965
    "Modified: 14.12.1996 / 15:37:47 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5966
    "Created: 2.8.1997 / 14:11:19 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5967
!
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5968
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5969
copyFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5970
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5971
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5972
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5973
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5974
cutFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5975
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5976
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5977
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5978
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5979
deleteFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5980
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5981
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5982
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5983
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5984
eraseFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5985
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5986
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5987
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  5988
14262
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5989
fileAddToJavaSourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5990
    "add the current path to java's sourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5991
     (only available with ST/J System"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5992
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  5993
    Java notNil ifTrue:[
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  5994
        self currentSelectedObjects do:[:each |
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  5995
            Java addToSourcePath:(each pathName)
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  5996
        ].
14262
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5997
    ].
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5998
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  5999
    "Created: / 9.11.1998 / 05:41:34 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6000
    "Modified: / 9.11.1998 / 05:56:00 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6001
!
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6002
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6003
openSettingsDialog
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6004
    |dialog|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6005
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6006
    dialog := FileBrowserV2SettingsDialog new.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6007
    dialog settingsDialog:self.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6008
    dialog allButOpen.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6009
    dialog doReload.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6010
    dialog openWindow
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6011
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6012
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6013
withSelectedFilesOrDirectoriesDo:aBlock
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6014
    |files dirs|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6015
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6016
    files := self currentSelectedFiles.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6017
    files notEmpty ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6018
        aBlock value:files.        
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6019
    ] ifFalse:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6020
        dirs := self currentSelectedDirectories.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6021
        dirs notEmpty ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6022
            aBlock value:dirs.        
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6023
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6024
    ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6025
! !
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6026
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6027
!AbstractFileBrowser methodsFor:'menu actions-help'!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6028
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6029
openAboutThisApplication
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6030
    "opens an about box for this application."
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6031
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6032
    Dialog aboutClass:self class.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6033
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6034
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6035
openHTMLDocument:relativeDocPath
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6036
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6037
! !
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6038
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6039
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6040
15905
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6041
canCvsAddAndCommit
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6042
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6043
    |selectedFiles|
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6044
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6045
    selectedFiles := self currentSelectedObjects.
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6046
    ^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]).
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6047
!
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6048
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6049
canRemoveCVSContainer
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6050
    ^ self currentSelectedFiles 
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6051
        contains:[:fileName|
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6052
            |dirOfFile cvsDir|
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6053
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6054
            dirOfFile := self getDirWithoutFileName:fileName.
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6055
            cvsDir := dirOfFile construct:'CVS'.
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6056
            cvsDir isDirectory
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6057
        ].
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6058
!
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6059
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6060
commitFilesToCVS:files
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6061
    |numFiles|
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6062
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6063
    (numFiles := files size) > 0 ifTrue:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6064
        self withActivityIndicationDo:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6065
            self cvsCommitFiles:files
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6066
        ]
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6067
    ]
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6068
!
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6069
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6070
cvsAddAndCommit
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6071
    self cvsAddAndCommitAsBinary:false
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6072
!
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6073
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6074
cvsAddAndCommitAsBinary:asBinary
8588
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6075
    |sel log logArg binArg cmd dir executionBlock nameString|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6076
321c1729db5b initial checkin
penk
parents:
diff changeset
  6077
    log := Dialog
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6078
        requestText:(resources string:'Enter initial log message:')
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6079
        lines:10
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6080
        columns:70
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6081
        initialAnswer:nil.
8322
cf10f08b6164 care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents: 8294
diff changeset
  6082
    log isNil ifTrue:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6083
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6084
    OperatingSystem isMSWINDOWSlike ifTrue:[
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6085
        logArg := '-m "' , log , '"'.
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6086
    ] ifFalse:[
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6087
        logArg := '-m ''' , log , ''''.
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6088
    ].
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6089
8588
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6090
    binArg := ''.
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6091
    asBinary ifTrue:[
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6092
        binArg := '-kb '.
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6093
    ].
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  6094
    sel := self currentSelectedFiles.
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6095
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6096
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6097
            log notNil ifTrue:[
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  6098
                sel notEmptyOrNil ifTrue:[
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6099
                    sel do:[:fn |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6100
                        |nameArg|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6101
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6102
                        nameArg := '"',fn baseName,'"'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6103
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6104
                        dir := self getDirWithoutFileName:fn.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6105
                        cmd := 'cvs add ',logArg,' ',binArg,nameArg.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6106
                        (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6107
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6108
                        cmd := ('cvs commit -l ',logArg,' ',nameArg).
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6109
                        (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6110
                        "/ mhmh - it seems that only old CVS implementations (at least turqoise)
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6111
                        "/ support and need the 'admin -kb' command.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6112
                        "/ newer ones use the '-kb' option in the 'cvs add' command
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6113
                        asBinary ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6114
                            cmd := ('cvs admin -kb ' , nameArg).
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6115
                            (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6116
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6117
                            cmd := ('cvs upd ' , nameArg).
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6118
                            (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6119
                        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6120
                    ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6121
                ] 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6122
            ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6123
        ].
4107
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6124
    nameString := 'Command> cvs add and commit'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6125
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6126
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  6127
    "Modified: / 17-02-2017 / 08:25:16 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6128
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6129
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6130
cvsAddBinaryAndCommit
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6131
    self cvsAddAndCommitAsBinary:true
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6132
!
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6133
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6134
cvsCommit
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6135
    |selectedFiles|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6136
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  6137
    selectedFiles:= self currentSelectedFiles.
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6138
    self cvsCommitFiles:selectedFiles
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6139
!
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6140
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6141
cvsCommitFiles:files
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6142
    |nFiles log logTmp s logArg msg executionBlock nameString |
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6143
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6144
    nFiles := files size.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6145
    nFiles == 0 ifTrue:[^ self].
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6146
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6147
    nFiles == 1 ifTrue:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6148
        msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6149
    ] ifFalse:[
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6150
        nFiles > 1 ifTrue:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6151
            msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6152
        ] ifFalse:[
6627
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  6153
            msg := resources string:'Enter log message for checkIn'
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6154
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6155
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6156
321c1729db5b initial checkin
penk
parents:
diff changeset
  6157
    log := Dialog
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6158
        requestText:msg
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6159
        lines:10
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6160
        columns:70
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6161
        initialAnswer:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6162
4663
d11b898b6fc5 start no process when commit is canceled
penk
parents: 4655
diff changeset
  6163
    log isNil ifTrue:[^ self].
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6164
    log := log replChar:$"  withString:'\"'.
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6165
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6166
    OperatingSystem isMSWINDOWSlike ifTrue:[
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6167
        "/ save the log message into another tempFile ...
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6168
        s := FileStream newTemporary.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6169
        logTmp := s fileName.
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6170
        s nextPutAll:log.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6171
        s close.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6172
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6173
        logArg := '-F "', logTmp pathName, '"'.
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6174
    ] ifFalse:[
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6175
        logArg := '-m ''' , log , ''''.
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6176
    ].
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6177
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  6178
    executionBlock := [:stream |
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6179
        [
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6180
            files do:[:fn |
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6181
                | dir nameArg cmd |
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6182
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6183
                nameArg := '"',fn baseName,'"'.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6184
                dir := fn directory.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6185
                cmd := 'cvs commit ',logArg,' ' , nameArg.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6186
stream showCR:fn pathName.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6187
                (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
4663
d11b898b6fc5 start no process when commit is canceled
penk
parents: 4655
diff changeset
  6188
            ] 
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6189
        ] ensure:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6190
            logTmp notNil ifTrue:[ logTmp remove ].
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6191
        ].
4107
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6192
    ].
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6193
    nameString := 'Command> cvs commit'.
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6194
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6195
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6196
14527
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6197
cvsCommitFolder
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6198
    |dir log logTmp s logArg msg executionBlock nameString |
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6199
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6200
    (dir := self currentDirectory) isNil ifTrue:[ ^ self ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6201
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6202
    msg := resources string:'Enter log message for checkIn of "%1"' with:(dir baseName).
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6203
    log := Dialog
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6204
        requestText:msg
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6205
        lines:10
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6206
        columns:70
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6207
        initialAnswer:nil.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6208
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6209
    log isNil ifTrue:[^ self].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6210
    log := log replChar:$"  withString:'\"'.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6211
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6212
    OperatingSystem isMSWINDOWSlike ifTrue:[
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6213
        "/ save the log message into another tempFile ...
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6214
        s := FileStream newTemporary.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6215
        logTmp := s fileName.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6216
        s nextPutAll:log.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6217
        s close.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6218
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6219
        logArg := '-F "', logTmp pathName, '"'.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6220
    ] ifFalse:[
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6221
        logArg := '-m ''' , log , ''''.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6222
    ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6223
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6224
    executionBlock := [:stream |
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6225
            [
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6226
                |cmd|
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6227
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6228
                cmd := 'cvs commit ',logArg.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6229
                (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6230
            ] ensure:[
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6231
                logTmp notNil ifTrue:[ logTmp remove ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6232
            ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6233
        ]. 
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6234
    
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6235
    nameString := 'Command> cvs commit'.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6236
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6237
!
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6238
9407
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6239
cvsCompareWithNewest
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6240
    |selectedFiles|
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6241
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6242
    selectedFiles:= self currentSelectedFiles.
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6243
    selectedFiles do:[:each |
11176
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6244
        |out diffs|
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6245
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  6246
        out := CharacterWriteStream new:100.
11176
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6247
        OperatingSystem 
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6248
            executeCommand:'cvs diff -b ',each baseName
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6249
            outputTo:out
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6250
            inDirectory:each directoryName.
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6251
        diffs := out contents.
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6252
        TextView openWith:diffs.
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6253
    ].
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6254
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6255
    "Modified: / 23-01-2012 / 14:08:28 / cg"
9407
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6256
!
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6257
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6258
cvsRemoveAndRemoveFromCVS:filesToRemove
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6259
    "remove the selected file(s) and their CVS containers - no questions asked"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6260
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6261
    |toRemove updateRunning executionBlock nameString|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6262
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6263
    updateRunning := self backgroundProcesses value notEmpty.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6264
    self killAllRunningBackgroundProcesses.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6265
    toRemove := OrderedCollection new.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6266
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6267
    executionBlock := 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6268
        [:stream |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6269
            |cmd logArg prevDir prevFiles|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6270
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6271
            OperatingSystem isMSWINDOWSlike ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6272
                logArg := '-m "' , 'removed via FileBrowser' , '"'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6273
            ] ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6274
                logArg := '-m ''' , 'removed via FileBrowser' , ''''.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6275
            ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6276
            prevFiles := ''.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6277
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6278
            filesToRemove do:[:fileName |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6279
                |dir file|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6280
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6281
                dir := fileName directory.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6282
                (prevDir notNil and:[prevDir ~= dir]) ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6283
                    cmd := 'cvs commit -l ',logArg, ' ',prevFiles.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6284
                    "/ Transcript show:prevDir; space; showCR:cmd.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6285
                    (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6286
                    prevFiles := ''.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6287
                ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6288
17116
625f4a3de032 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17024
diff changeset
  6289
                OsError handle:[:ex|
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6290
                    "was not able to remove it"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6291
                    | lastError msg |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6292
                    lastError := OperatingSystem lastErrorString.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6293
                    msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6294
                    lastError isNil ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6295
                        msg := msg , '\\(' , lastError , ')'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6296
                    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6297
                    Dialog warn:msg withCRs
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6298
                ] do:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6299
                    (fileName isSymbolicLink) ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6300
                        fileName remove.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6301
                        file := fileName baseName.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6302
                        cmd := ('cvs remove -f "',file,'"').
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6303
                        (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6304
                        "/ Transcript show:dir; space; showCR:cmd.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6305
                    ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6306
                ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6307
                prevDir := dir.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6308
                prevFiles := prevFiles,' ',file.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6309
            ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6310
            cmd := 'cvs commit -l ',logArg, ' ',prevFiles.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6311
            "/ Transcript show:prevDir; space; showCR:cmd.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6312
            (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6313
        ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6314
    nameString := 'Command> cvs remove and commit ', filesToRemove first baseName.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6315
    filesToRemove size > 1 ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6316
        nameString := nameString, ' ...'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6317
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6318
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6319
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6320
321c1729db5b initial checkin
penk
parents:
diff changeset
  6321
cvsRemoveFileAndCVSContainer
12493
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6322
    |files|
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6323
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6324
    files := self currentSelectedFiles copy.
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6325
    self removeFilesAndCVSContainers:files
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6326
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6327
9338
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6328
cvsRevisionLog
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6329
    | cmd sel executionBlock nameString|
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6330
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6331
    sel := self currentSelectedObjects.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6332
    sel isEmpty ifTrue:[ ^ self ].
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6333
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6334
    executionBlock := [:stream |
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6335
        sel do:[:fn |
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6336
            | dir nameArg |
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6337
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6338
            nameArg := '"',fn baseName,'"'.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6339
            dir := fn directory.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6340
            cmd := 'cvs log ' , nameArg.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6341
            (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6342
        ]
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6343
    ].
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6344
    nameString := 'Command> cvs log'.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6345
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6346
!
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6347
8562
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6348
cvsTagSelection
12856
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6349
    |tag tags cmd|
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6350
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6351
    tag := Dialog
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6352
                request:(resources string:'Tag (possibly multiple, separated by ";"):')
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6353
                initialAnswer:(CVSSourceCodeManager recentTag).
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6354
    tag isEmptyOrNil ifTrue:[^ self ].
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6355
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6356
    CVSSourceCodeManager recentTag:tag.
8562
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6357
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6358
    CVSSourceCodeManager notNil ifTrue:[
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6359
        cmd := CVSSourceCodeManager cvsExecutable.
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6360
    ] ifFalse:[
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6361
        cmd := 'cvs'.
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6362
    ].
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6363
12856
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6364
    tags := tag asCollectionOfSubstringsSeparatedByAny:',;'.
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6365
    tags do:[:eachTag |
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6366
        self executeCommand:('%1 tag -F "%2" %3' 
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6367
                                bindWith:cmd 
12858
d9d33f96ea6b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12856
diff changeset
  6368
                                with:(eachTag withoutSeparators) 
12856
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6369
                                with:(self makeFileNameArgumentString))
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6370
    ].
8562
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6371
!
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6372
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6373
cvsUpdateAll
321c1729db5b initial checkin
penk
parents:
diff changeset
  6374
    | cmd |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6375
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6376
    CVSSourceCodeManager notNil ifTrue:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6377
        cmd := CVSSourceCodeManager cvsExecutable.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6378
    ] ifFalse:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6379
        cmd := 'cvs'.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6380
    ].
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6381
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6382
    self executeCommand:(cmd, ' upd -l').
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6383
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6384
321c1729db5b initial checkin
penk
parents:
diff changeset
  6385
cvsUpdateAllRecursive
321c1729db5b initial checkin
penk
parents:
diff changeset
  6386
    | cmd |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6387
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6388
    CVSSourceCodeManager notNil ifTrue:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6389
        cmd := CVSSourceCodeManager cvsExecutable.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6390
    ] ifFalse:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6391
        cmd := 'cvs'.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6392
    ].
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6393
    self executeCommand:(cmd, ' upd -d').
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6394
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6395
321c1729db5b initial checkin
penk
parents:
diff changeset
  6396
cvsUpdateSelection
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6397
    |stream cmd|
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6398
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6399
    CVSSourceCodeManager notNil ifTrue:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6400
        cmd := CVSSourceCodeManager cvsExecutable.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6401
    ] ifFalse:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6402
        cmd := 'cvs'.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6403
    ].
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6404
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  6405
    stream := CharacterWriteStream new.
8563
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6406
    stream 
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6407
        nextPutAll:cmd; 
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6408
        nextPutAll:' upd ';
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6409
        nextPutAll:(self makeFileNameArgumentString).
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6410
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6411
    self executeCommand:stream contents.
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6412
!
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6413
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6414
makeFileNameArgumentString
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6415
    |stream|
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6416
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  6417
    stream := CharacterWriteStream new.
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6418
    self currentSelectedFiles do:[: file |
8563
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6419
        stream nextPut:$".
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6420
        stream nextPutAll:file baseName.
8563
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6421
        stream nextPutAll:'" '.
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6422
    ].
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6423
    ^ stream contents.
12493
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6424
!
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6425
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6426
removeFilesAndCVSContainers:files
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6427
    |numFiles question aswer|
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6428
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6429
    (numFiles := files size) > 0 ifTrue:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6430
        numFiles > 1 ifTrue:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6431
            question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6432
        ] ifFalse:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6433
            question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold)
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6434
        ].
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6435
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6436
        aswer := Dialog 
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6437
                confirm:question withCRs
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6438
                yesLabel:(resources string:'Remove')
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6439
                noLabel:(resources string:'Cancel').
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6440
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6441
        aswer ifTrue:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6442
            self withActivityIndicationDo:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6443
                self cvsRemoveAndRemoveFromCVS:files
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6444
            ]
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6445
        ]
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6446
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6447
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6448
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  6449
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6450
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6451
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6452
mercurialAdd
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6453
    |executionBlock sel maxCmdSize|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6454
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6455
    maxCmdSize := 512.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6456
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6457
    sel := self currentSelectedObjects.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6458
    sel isEmptyOrNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6459
        ^ self
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6460
    ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6461
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6462
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6463
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6464
            |prevDir cmd|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6465
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6466
            prevDir := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6467
            sel do:[:fn |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6468
                |nameArg dir|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6469
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6470
                nameArg := '"',fn baseName,'"'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6471
                dir := fn directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6472
                (dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6473
                    "/ flush
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6474
                    cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6475
                        (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6476
                        cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6477
                    ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6478
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6479
                cmd isNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6480
                    cmd := 'hg add'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6481
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6482
                cmd := cmd,' ',nameArg.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6483
                prevDir := dir.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6484
            ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6485
            cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6486
                (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6487
                cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6488
            ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6489
            stream nextPutLine:'Commit to finish the transaction'. 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6490
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6491
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6492
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6493
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6494
    "Created: / 15-01-2012 / 15:55:47 / cg"
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6495
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6496
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6497
mercurialCommit
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6498
    |dir executionBlock|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6499
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6500
"/    dir := self currentDirectory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6501
    dir := self directoryContentsBrowser directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6502
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6503
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6504
            (self getExecutionBlockForCommand:'hg commit' 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6505
                  inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6506
            stream nextPutLine:'Push to sync other repositories'. 
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  6507
        ].
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6508
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6509
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6510
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6511
    "Created: / 15-01-2012 / 16:21:27 / cg"
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6512
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6513
11144
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6514
mercurialInit
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6515
    |dir executionBlock|
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6516
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6517
    dir := self directoryContentsBrowser directory.
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6518
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6519
    (Dialog confirm:(resources 
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6520
                        string:'Initialize new Mercurial Repository in %1?'
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6521
                        with:dir baseName)) ifFalse:[^ self].
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6522
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6523
    executionBlock := 
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6524
        [:stream |
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6525
            (self getExecutionBlockForCommand:('hg init')
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6526
                  inDirectory:dir) value:stream.
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6527
        ].
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6528
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6529
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'.
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6530
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6531
    "Created: / 17-01-2012 / 15:58:46 / cg"
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6532
!
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6533
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6534
mercurialPush
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6535
    |destination dir executionBlock|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6536
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6537
    destination := Dialog request:'Mercurial Repository'
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6538
                    initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName).
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6539
    destination isEmptyOrNil ifTrue:[^ self].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6540
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6541
    LastMercurialRepository := destination.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6542
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6543
    dir := self directoryContentsBrowser directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6544
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6545
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6546
            (self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination)
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6547
                  inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6548
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6549
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6550
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6551
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6552
    "Created: / 15-01-2012 / 16:29:41 / cg"
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6553
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6554
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6555
mercurialStatus
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6556
    |executionBlock sel maxCmdSize|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6557
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6558
    maxCmdSize := 512.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6559
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6560
    sel := self currentSelectedObjects.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6561
    sel isEmptyOrNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6562
        ^ self
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6563
    ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6564
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6565
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6566
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6567
            |prevDir cmd|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6568
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6569
            prevDir := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6570
            sel do:[:fn |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6571
                |nameArg dir|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6572
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6573
                nameArg := '"',fn baseName,'"'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6574
                dir := fn directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6575
                (dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6576
                    "/ flush
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6577
                    cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6578
                        (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6579
                        cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6580
                    ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6581
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6582
                cmd isNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6583
                    cmd := 'hg status'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6584
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6585
                cmd := cmd,' ',nameArg.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6586
                prevDir := dir.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6587
            ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6588
            cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6589
                (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6590
                cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6591
            ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6592
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6593
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6594
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6595
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6596
    "Created: / 15-01-2012 / 19:43:08 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6597
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6598
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6599
!AbstractFileBrowser methodsFor:'menu actions-tools'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6600
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  6601
allFilesInSelectedDirectoriesForWhich:aBlock
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  6602
    ^ self class allFilesInDirectories:(self currentSelectedDirectories) forWhich:aBlock
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  6603
!
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  6604
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6605
conversionChainFrom:inSuffix to:outSuffix
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6606
    |conv|
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6607
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6608
    inSuffix = outSuffix ifTrue:[
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6609
        ^ nil
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6610
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6611
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6612
    "/ q&d hack to get my images converted for old html-browsers...
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6613
    "/ this should come from somewhere else (do we need an ImageConverter class ?).
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6614
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6615
    conv := OrderedCollection new.
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6616
    conv add:('anytopnm %1 > %2' -> 'pnm').
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6617
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6618
    outSuffix = 'png' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6619
        conv add:('pnmtopng %1 > %2' -> 'png').
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6620
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6621
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6622
    outSuffix = 'gif' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6623
        conv add:('ppmquant 256 %1 | ppmtogif > %2' -> 'gif').
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6624
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6625
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6626
    outSuffix = 'xpm' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6627
        conv add:('ppmtoxpm %1 > %2' -> 'xpm').
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6628
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6629
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6630
    outSuffix = 'jpg' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6631
        conv add:('ppmtojpeg %1 > %2' -> 'jpg').
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6632
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6633
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6634
    self error:'unimplemented conversion'.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6635
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6636
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6637
convertImageFrom:fileName to:outFile onError:exceptionBlock
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6638
    |writer image outSuffix|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6639
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6640
    outSuffix := outFile suffix.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6641
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6642
    ((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6643
    and:[ (image := Image fromFile:fileName) notNil
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6644
    and:[ writer canRepresent:image ]]) ifTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6645
        "/ can do it with Smalltalk tools
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6646
        writer save:image onFile:outFile.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6647
    ] ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6648
        "/ use external tools (pbm-package, if available)
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6649
        self 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6650
            convertImageUsingExternalFileToolsFrom:fileName 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6651
            toSuffix:outSuffix 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6652
            onError:exceptionBlock.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6653
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6654
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6655
    "Created: / 20-05-2010 / 11:12:36 / cg"
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6656
!
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6657
4367
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6658
convertImageToGIF
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6659
    self convertImageToSuffix:'gif'
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6660
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6661
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6662
convertImageToJPG
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6663
    self convertImageToSuffix:'jpg'
4531
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  6664
!
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  6665
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  6666
convertImageToPNG
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6667
    self convertImageToSuffix:'png'
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6668
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6669
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6670
convertImageToSuffix:outSuffix
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6671
    |outFile filesToConvert|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6672
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6673
    self withActivityIndicationDo:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6674
        filesToConvert := self currentSelectedObjects copy.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6675
        filesToConvert do:[:fileName |
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6676
            self notify:(resources string:'Converting: %1...' with:fileName baseName).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6677
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6678
            fileName isDirectory ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6679
                |skip|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6680
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6681
                skip := false.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6682
                outFile := fileName withSuffix:outSuffix.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6683
                outFile exists ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6684
                    |answer|
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6685
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6686
                    answer := Dialog 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6687
                        confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold)
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6688
                        default:false.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6689
                    answer isNil ifTrue:[AbortSignal raise].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6690
                    answer ifFalse:[ skip := true ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6691
                ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6692
                skip ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6693
                    self 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6694
                        convertImageFrom:fileName 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6695
                        to:outFile 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6696
                        onError:[:errMsg |
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6697
                            filesToConvert size == 1 ifTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6698
                                Dialog warn:errMsg
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6699
                            ] ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6700
                                (Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6701
                                    ^ self
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6702
                                ]
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6703
                            ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6704
                        ].
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6705
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6706
                    self updateAndSelect:nil.
4367
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6707
                ]
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6708
            ]
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6709
        ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6710
        self notify:nil.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6711
    ]
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6712
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6713
    "Modified: / 20-05-2010 / 11:15:35 / cg"
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6714
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6715
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6716
convertImageToXPM
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6717
    self convertImageToSuffix:'xpm'
4367
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6718
!
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6719
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6720
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6721
    |inFile outFile chainOfConversions conversionStream 
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6722
     eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6723
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6724
    chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6725
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6726
    chainOfConversions isNil ifTrue:[ 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6727
        self warn:('Don''t know how to convert from %1 to %2' bindWith:fileName suffix with:outSuffix).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6728
        ^ false 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6729
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6730
    conversionStream := chainOfConversions readStream.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6731
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6732
    inFile := fileName.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6733
    eachConversionSuffixCommandPair := conversionStream next.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6734
    eachConversionCommand := eachConversionSuffixCommandPair key.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6735
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6736
    eachConversionCommand == #readToXPM ifTrue:[
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6737
        |image tempStreamXPM|
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6738
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6739
        image := Image fromFile:(inFile pathName).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6740
        image isNil ifTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6741
            self warn:'Unknown format/not an image: ' , inFile baseName.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6742
            ^ false.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6743
        ].
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6744
        tempStreamXPM  := FileStream newTemporaryWithSuffix:'xpm'.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6745
        XPMReader save:image onStream:tempStreamXPM.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6746
        tempStreamXPM close.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6747
        inFile := tempStreamXPM fileName.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6748
        eachConversionSuffixCommandPair := conversionStream next.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6749
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6750
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6751
    [
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6752
        |command errOutput errMsg|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6753
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6754
        [eachConversionSuffixCommandPair notNil] whileTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6755
            eachConversionCommand := eachConversionSuffixCommandPair key.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6756
            eachConversionSuffix  := eachConversionSuffixCommandPair value.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6757
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6758
            self notify:(resources string:'Converting: %1 to %2...' with:fileName baseName with:eachConversionSuffix).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6759
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6760
            outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6761
            command := eachConversionCommand 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6762
                            bindWith:(inFile pathName)
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6763
                            with:(outFile pathName).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6764
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6765
            errOutput := String writeStream.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6766
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6767
            (OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6768
                errMsg := resources
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6769
                            stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6770
                            with:inFile baseName allBold
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6771
                            with:eachConversionSuffix
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6772
                            with:eachConversionCommand allBold
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6773
                            with:errOutput contents.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6774
                exceptionBlock value:errMsg.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6775
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6776
                (inFile ~= fileName) ifTrue:[inFile remove].
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6777
                outFile remove.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6778
                ^ false
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6779
            ].
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6780
            (inFile ~= fileName) ifTrue:[inFile remove].
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6781
            inFile := outFile.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6782
            eachConversionSuffixCommandPair := conversionStream next
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6783
        ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6784
        outFile moveTo:(fileName withSuffix:(chainOfConversions last value)).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6785
    ] ifCurtailed:[
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6786
        (inFile ~= fileName) ifTrue:[inFile remove].
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6787
        outFile remove.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6788
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6789
    ^ true.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6790
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6791
    "Created: / 20-05-2010 / 11:05:50 / cg"
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6792
!
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6793
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6794
createProjectAndOpenProjectBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  6795
    |nm f s directory|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6796
321c1729db5b initial checkin
penk
parents:
diff changeset
  6797
    self currentFilesAreInSameDirectory ifFalse:[^ self].
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  6798
    directory := self currentDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6799
    nm := directory baseName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6800
    f := (directory  construct:nm) withSuffix:'prj'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6801
    f exists ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6802
        Dialog warn:'A file named ' , f baseName , ' already exists.'.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6803
        ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6804
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6805
    s := f writeStream.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6806
    s nextPutAll:'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6807
name            ''' , nm , '''
321c1729db5b initial checkin
penk
parents:
diff changeset
  6808
type            #classLibrary
321c1729db5b initial checkin
penk
parents:
diff changeset
  6809
package         #''private:' , nm , '''
321c1729db5b initial checkin
penk
parents:
diff changeset
  6810
prerequisites   nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  6811
321c1729db5b initial checkin
penk
parents:
diff changeset
  6812
classes      #( )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6813
'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6814
    s close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6815
    ProjectBrowser openOnFile:f.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6816
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6817
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6818
doExecuteCommand
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6819
    "execute an OperatingSystem-command"
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6820
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6821
    | action fileName|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6822
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6823
    fileName := self firstSelectedFile.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6824
    action := [:command | 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6825
                self addToCommandHistory:command for:fileName.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6826
                self executeCommand:command.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6827
              ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6828
    self askForCommandFor:fileName thenDo:action
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6829
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6830
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6831
doExecuteScript
16941
9edb5cb2922f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16911
diff changeset
  6832
    "execute a Smalltalk script"
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6833
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6834
    |textHolder dialog template dummyClass dummyInstance|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6835
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6836
    template :=
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6837
'"/ Smalltalk script:
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6838
16084
mawalch
parents: 15981
diff changeset
  6839
"/ the following variables are accessible:
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6840
"/      directory       (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ')
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6841
"/      selectedFiles   (= ...)
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6842
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6843
"/ Beginner warning: Smalltalk know-how is useful here ;-).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6844
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6845
"/ Useful operations are:
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6846
"/      directory directoryContentsDo:[:eachBaseNameString | ...]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6847
"/      directory directoryContentsAsFilenamesDo:[:eachFilename | ...]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6848
"/      directory directory
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6849
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6850
"/ example: move all files which match a aarticular pattern to
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6851
"/          a separate directory:
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6852
"/ 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6853
"/        |directory idx prefix rest newDir oldFile newFile|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6854
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6855
"/        directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6856
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6857
"/        directory directoryContentsDo:[:eachBaseNameString |
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6858
"/            (eachBaseNameString includes:$_) ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6859
"/                idx := eachBaseNameString indexOf:$_.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6860
"/                prefix := eachBaseNameString copyTo:(idx - 1).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6861
"/                rest := eachBaseNameString copyFrom:(idx + 1).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6862
"/                newDir := directory construct:prefix.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6863
"/                newDir exists ifFalse:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6864
"/                    (Dialog confirm:''Create '' , newDir pathName) ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6865
"/                        newDir makeDirectory.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6866
"/                    ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6867
"/                ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6868
"/                newDir exists ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6869
"/                    oldFile := directory construct:eachBaseNameString.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6870
"/                    newFile := newDir construct:rest.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6871
"/                    oldFile moveTo:newFile
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6872
"/                ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6873
"/            ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6874
"/        ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6875
'.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6876
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6877
    LastScriptBlockString isNil ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6878
        LastScriptBlockString := template.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6879
    ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6881
    textHolder := ValueHolder new.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6882
    dialog := Dialog 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6883
                 forRequestText:(resources string:'Enter script')
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6884
                 editViewClass:CodeView
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6885
                 lines:25 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6886
                 columns:70
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6887
                 initialAnswer:LastScriptBlockString
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6888
                 model:textHolder.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6889
    dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6890
    dialog open.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6891
    dialog accepted ifFalse:[^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6892
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6893
    LastScriptBlockString := textHolder value.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6894
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6895
    Class classConventionViolationConfirmationQuerySignal 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6896
        answer:true
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6897
        do:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6898
            dummyClass := Object class
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6899
                    name:#Dummy
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6900
                    inEnvironment:nil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6901
                    subclassOf:Object
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6902
                    instanceVariableNames:'directory selectedFiles'
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6903
                    variable:false
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6904
                    words:true
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6905
                    pointers:true
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6906
                    classVariableNames:''
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6907
                    poolDictionaries:''
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6908
                    category:#dummyCategory
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6909
                    comment:nil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6910
                    changed:true.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6911
        ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6912
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6913
    dummyInstance := dummyClass basicNew.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6914
    dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6915
    dummyInstance instVarAt:2 put:(self currentSelectedFiles value).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6916
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6917
    Compiler
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6918
        evaluate:textHolder value
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6919
        in:nil 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6920
        receiver:dummyInstance 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6921
        notifying:nil 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6922
        logged:false
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6923
        ifFail:[]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6924
        compile:true.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6925
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6926
"/    fileName := self firstSelectedFile.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6927
"/    action := [:command | 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6928
"/                self addToCommandHistory:command for:fileName.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6929
"/                self executeCommand:command.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6930
"/              ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6931
"/    self askForCommandFor:fileName thenDo:action
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6932
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6933
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  6934
doMake
7938
e8725dda1df6 make action for windows...
Claus Gittinger <cg@exept.de>
parents: 7900
diff changeset
  6935
    |dir cmd|
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  6936
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6937
    cmd := self makeCommandHolder value.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6938
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6939
    "Make"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6940
    cmd = 'make' ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6941
        dir := self theSingleSelectedDirectoryOrNil.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6942
        OperatingSystem isMSWINDOWSlike ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6943
            dir notNil ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6944
                (dir construct:'bmake.bat') exists ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6945
                    cmd := 'bmake.bat'.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6946
                ]
7938
e8725dda1df6 make action for windows...
Claus Gittinger <cg@exept.de>
parents: 7900
diff changeset
  6947
            ]
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6948
        ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6949
        self executeCommand:cmd.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6950
        ^self.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6951
    ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6952
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6953
    "Apache ant"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6954
    cmd = 'ant' ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6955
        self executeCommand:cmd.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6956
        ^self.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6957
    ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6958
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6959
    "Add more here..."
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6960
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  6961
    "Modified (comment): / 13-04-2012 / 17:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  6962
!
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  6963
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6964
doOpenCBrowser
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  6965
    "the CBrowser is an eXept-internal C-language IDE tool.
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  6966
     (no longer of much interest, since we have VC and eclipse, but this was written
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  6967
     20 years ago ;-)"
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  6968
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6969
    |destDir|
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6970
10747
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  6971
    (CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  6972
        Smalltalk loadPackage:'exept:CC'
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  6973
    ].
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6974
    destDir := self currentDirectory.
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6975
    CBrowser::Browser openIn:destDir pathName
10747
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  6976
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  6977
    "Modified: / 04-10-2011 / 13:41:31 / cg"
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  6978
    "Modified (comment): / 27-07-2012 / 20:41:40 / cg"
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6979
!
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  6980
7829
0e3be44e2f01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7788
diff changeset
  6981
doOpenExplorer
11642
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  6982
    self currentDirectory asFilename openExplorer
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  6983
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  6984
    "Modified: / 21-07-2012 / 12:28:36 / cg"
7829
0e3be44e2f01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7788
diff changeset
  6985
!
0e3be44e2f01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7788
diff changeset
  6986
12473
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  6987
doOpenFinder
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  6988
    self currentDirectory asFilename openFinder
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  6989
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  6990
    "Modified: / 21-07-2012 / 12:28:36 / cg"
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  6991
!
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  6992
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  6993
doOpenMonticelloBrowser
12874
f08360e7ac62 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 12871
diff changeset
  6994
    MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello'].
f08360e7ac62 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 12871
diff changeset
  6995
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  6996
    self withWaitCursorDo:[
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  6997
        self currentSelectedFiles do:[:fn |
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  6998
            |version snapshot|
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  6999
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7000
            fn suffix asLowercase = 'mcz' ifTrue:[
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7001
                version := MCMczReader versionFromFile:fn.
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7002
                snapshot := version snapshot.
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7003
                (Tools::ChangeSetBrowser2 
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7004
                        on: snapshot asChangeSet
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7005
                        label: version info name)
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7006
                    beTwoColumn;
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7007
                    targetNamespace:nil;
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7008
                    targetPackage:nil;
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7009
                    open
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7010
                ]
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7011
        ]
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7012
    ]
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7013
!
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7014
4317
bf3f150809c2 settings is a new application now and will be inserted under tools in
penk
parents: 4294
diff changeset
  7015
doOpenSettings
8168
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  7016
    self openSettingsDialog
4317
bf3f150809c2 settings is a new application now and will be inserted under tools in
penk
parents: 4294
diff changeset
  7017
!
bf3f150809c2 settings is a new application now and will be inserted under tools in
penk
parents: 4294
diff changeset
  7018
9343
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7019
doOpenWithShellCommand
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7020
    "open using win32-shell"
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7021
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7022
    |fileName|
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7023
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7024
    fileName := self firstSelectedFile.
9405
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7025
    fileName notNil ifTrue:[    
11642
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7026
        OperatingSystem
9405
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7027
            openApplicationForDocument:fileName pathName 
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7028
            operation:#open
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7029
    ]
11642
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7030
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7031
    "Modified: / 21-07-2012 / 12:26:10 / cg"
9343
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7032
!
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7033
7104
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7034
editMode:aSymbol
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7035
    self 
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7036
        applicationNamed:#FileApplicationNoteBook
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7037
        ifPresentDo:[:appl |
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7038
            |subApp|
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7039
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7040
            subApp := appl selectedApplication.
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7041
            subApp notNil ifTrue:[
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7042
                ^ subApp perform:aSymbol
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7043
            ]
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7044
        ].
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7045
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7046
    "Created: / 11-09-2006 / 12:42:08 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7047
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7048
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7049
editModeInsert
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7050
    self editMode:#editModeInsert
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7051
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7052
    "Created: / 11-09-2006 / 12:40:36 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7053
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7054
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7055
editModeInsertAndSelect
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7056
    self editMode:#editModeInsertAndSelect
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7057
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7058
    "Created: / 11-09-2006 / 12:40:45 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7059
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7060
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7061
editModeOverwrite
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7062
    self editMode:#editModeOverwrite
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7063
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7064
    "Modified: / 11-09-2006 / 12:42:26 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7065
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7066
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7067
fetchFileByURL
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7068
    |url destinationFilename|
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7069
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  7070
    url := Dialog request:(resources string:'URL to Fetch:') initialAnswer:'http://host/path'.
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7071
    url isEmptyOrNil ifTrue:[^ self].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7072
    url := url asURL.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7073
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  7074
    destinationFilename := Dialog request:(resources string:'Download As:') initialAnswer:(UnixFilename named:url path) baseName.
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7075
    destinationFilename isEmptyOrNil ifTrue:[^ self].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7076
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7077
    destinationFilename := self currentDirectory asFilename / destinationFilename.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7078
    destinationFilename exists ifTrue:[
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7079
        |answer|
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7080
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7081
        answer := Dialog 
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7082
            confirm:(resources string:'Overwrite existing %1 ?' with:destinationFilename baseName allBold)
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7083
            default:false.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7084
        answer ~~ true ifTrue:[^ self].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7085
    ].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7086
    self withActivityIndicationDo:[
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7087
        self notify:(resources string:'Fetching %1' with:url).
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7088
        HTTPInterface get:url destinationFile:destinationFilename.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7089
        self notify:nil.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7090
    ]
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7091
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  7092
    "Modified: / 29-11-2017 / 12:26:13 / cg"
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7093
!
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7094
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7095
fileContentsAsByteArray
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7096
    |file fileSize|
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7097
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7098
    file := self firstSelectedFile.
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7099
    file isNil ifTrue:[^ self ].
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7100
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7101
    file := file asFilename.
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7102
    
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7103
    (fileSize := file fileSize) > (1024*1024) ifTrue:[
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7104
        fileSize > (128*1024*1024) ifTrue:[
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7105
            Dialog warn:(resources string:'File is too big').
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7106
            ^ self.
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7107
        ].
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7108
        (Dialog confirm:(resources 
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7109
                            string:'File is big (%1) - proceed?' 
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7110
                            with:(UnitConverter fileSizeStringFor:fileSize))
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7111
        ) ifFalse:[^ self].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7112
    ].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7113
    file binaryContentsOfEntireFile inspect
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7114
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7115
    "Modified: / 19-11-2017 / 14:58:43 / cg"
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7116
!
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7117
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7118
fileFileIn
321c1729db5b initial checkin
penk
parents:
diff changeset
  7119
    "fileIn the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7120
321c1729db5b initial checkin
penk
parents:
diff changeset
  7121
    self fileFileInLazy:false 
321c1729db5b initial checkin
penk
parents:
diff changeset
  7122
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7123
7324
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7124
fileFileIn:aFilename lazy:lazy
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7125
    "fileIn a file"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7126
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7127
    self withActivityIndicationDo:[
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7128
        self notify:('File in:', aFilename asFilename baseName).
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7129
        self singleFileFileIn:aFilename lazy:lazy.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7130
        self notify:nil.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7131
    ]
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7132
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7133
    "Created: / 20-09-2006 / 14:28:35 / cg"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7134
!
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7135
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7136
fileFileInLazy
321c1729db5b initial checkin
penk
parents:
diff changeset
  7137
    "fileIn the selected file(s). Do a quick load (no compilation)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7138
321c1729db5b initial checkin
penk
parents:
diff changeset
  7139
    self fileFileInLazy:true 
321c1729db5b initial checkin
penk
parents:
diff changeset
  7140
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7141
321c1729db5b initial checkin
penk
parents:
diff changeset
  7142
fileFileInLazy:lazy
321c1729db5b initial checkin
penk
parents:
diff changeset
  7143
    "fileIn the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7144
7324
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7145
    self currentSelectedFiles do:[:fileName |
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7146
        self fileIn:fileName lazy:lazy
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7147
    ].
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7148
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7149
    "Modified: / 20-09-2006 / 14:29:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7150
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7151
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7152
fileFileInPackage
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7153
    "assuming the current directory is a package directory, load it"
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7154
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7155
    |packageDir dir path top packageID|
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7156
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7157
    "/ find a reasonable package-id (walk up until we find stx)
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7158
    path := ''.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7159
    dir := packageDir := self currentDirectory.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7160
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7161
    top := (Smalltalk projectDirectoryForPackage:'stx') asFilename.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7162
    [ (dir / 'stx') = top ] whileFalse:[
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7163
        path := dir baseName , '/' , path.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7164
        dir := dir directory.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7165
        dir isNil ifTrue:[
12707
6e9276c4fc95 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 12684
diff changeset
  7166
            Dialog warn:'Could not find a path from "stx" to the current directory.'.
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7167
            "/ should ask the user for a packageID and proceed...
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7168
            ^  self.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7169
        ].
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7170
    ].
12707
6e9276c4fc95 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 12684
diff changeset
  7171
    packageID := path copyButLast:1.
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7172
    Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7173
!
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7174
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7175
fileFileInToNameSpace
321c1729db5b initial checkin
penk
parents:
diff changeset
  7176
    "fileIn the selected file(s)<into a nameSpace"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7177
321c1729db5b initial checkin
penk
parents:
diff changeset
  7178
    |ns listOfKnownNameSpaces|
321c1729db5b initial checkin
penk
parents:
diff changeset
  7179
321c1729db5b initial checkin
penk
parents:
diff changeset
  7180
    listOfKnownNameSpaces := Set new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7181
    NameSpace 
6672
478b83a3753a max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents: 6671
diff changeset
  7182
        allNameSpaces 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7183
            do:[:eachNameSpace | 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7184
                listOfKnownNameSpaces add:eachNameSpace name
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7185
            ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7186
    listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7187
321c1729db5b initial checkin
penk
parents:
diff changeset
  7188
    ns := Dialog 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7189
                request:'During fileIn, new classes are created in nameSpace:'
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7190
                initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7191
                list:listOfKnownNameSpaces.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7192
    ns isEmptyOrNil ifTrue:[^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  7193
321c1729db5b initial checkin
penk
parents:
diff changeset
  7194
    LastEnforcedNameSpace := ns.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7195
    ns := NameSpace name:ns.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7196
321c1729db5b initial checkin
penk
parents:
diff changeset
  7197
    Class nameSpaceQuerySignal 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7198
        answer:ns
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7199
        do:[ 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7200
            self fileFileInLazy:false 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7201
        ] 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7202
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7203
321c1729db5b initial checkin
penk
parents:
diff changeset
  7204
fileFindAllDuplicates
321c1729db5b initial checkin
penk
parents:
diff changeset
  7205
    "scan directory and all subdirs for duplicate files"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7206
321c1729db5b initial checkin
penk
parents:
diff changeset
  7207
    |fileNames dir infoDir filesBySize
321c1729db5b initial checkin
penk
parents:
diff changeset
  7208
     result info dirPrefix myName stream textBox maxLength directories|
321c1729db5b initial checkin
penk
parents:
diff changeset
  7209
321c1729db5b initial checkin
penk
parents:
diff changeset
  7210
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  7211
    self withActivityIndicationDo:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7212
        result := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7213
        myName := self class name asString.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7214
        directories := self currentSelectedDirectories.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7215
        directories isEmpty ifTrue:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7216
        
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7217
        dir := directories first.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7218
"/        self label: myName, '- gathering file names ...'.
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7219
        [
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7220
            fileNames := dir recursiveDirectoryContents.
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7221
        ] on:FileStream openErrorSignal do:[:ex|
6352
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7222
            self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' 
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7223
                            with:ex pathName
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7224
                            with:ex description).
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7225
            ^ self
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7226
        ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  7227
        fileNames := fileNames 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  7228
                        collect:[:fn | dir construct:fn]
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  7229
                        thenSelect:[:fn | fn isDirectory not].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7230
321c1729db5b initial checkin
penk
parents:
diff changeset
  7231
"/        self label:myName , '- gathering sizes ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7232
        infoDir := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7233
        fileNames do:[:fn |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7234
            infoDir at:fn put:(fn fileSize)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7235
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7236
14497
6d95f7c8d28e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14419
diff changeset
  7237
        "/ for each, get the file's size.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7238
        "/ in a first pass, look for files of the same size and
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7239
        "/ compare them ...
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7240
321c1729db5b initial checkin
penk
parents:
diff changeset
  7241
"/        self label:myName , '- preselect possible duplicates ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7242
        filesBySize := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7243
        infoDir keysAndValuesDo:[:fn :sz |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7244
            |entry|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7245
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7246
            entry := filesBySize at:sz ifAbsentPut:[Set new].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7247
            entry add:fn.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7248
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7249
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7250
        "/ any of same size ?
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7251
321c1729db5b initial checkin
penk
parents:
diff changeset
  7252
"/        self label:myName , '- checking for duplicates ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7253
        filesBySize do:[:entry |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7254
            |files|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7255
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7256
            entry size > 1 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7257
                files := entry asArray.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7258
                1 to:files size-1 do:[:idx1 |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7259
                    idx1+1 to:files size do:[:idx2 |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7260
                        |fn1 fn2|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7261
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7262
                        fn1 := files at:idx1.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7263
                        fn2 := files at:idx2.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7264
321c1729db5b initial checkin
penk
parents:
diff changeset
  7265
"/                        self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7266
                        (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7267
                            "/ compare the files
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7268
                            (fn1 sameContentsAs:fn2) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7269
"/                                Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7270
                                result at:fn1 put:fn2.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7271
                            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7272
                        ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7273
                    ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7274
                ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7275
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7276
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7277
321c1729db5b initial checkin
penk
parents:
diff changeset
  7278
"/        self label:myName , '- sorting ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7279
        dirPrefix := dir pathName.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7280
        result := result associations.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7281
        result := result collect:[:assoc |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7282
                                        |f1 f2|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7283
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7284
                                        f1 := assoc key name.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7285
                                        f2 := assoc value name.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7286
                                        (f1 startsWith:dirPrefix) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7287
                                            f1 := f1 copyFrom:dirPrefix size + 2.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7288
                                        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7289
                                        (f2 startsWith:dirPrefix) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7290
                                            f2 := f2 copyFrom:dirPrefix size + 2.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7291
                                        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7292
                                        f1 < f2 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7293
                                            f2 -> f1
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7294
                                        ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7295
                                            f1 -> f2
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7296
                                        ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7297
                                ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7298
        result sort:[:f1 :f2 | f2 value < f1 value].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7299
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7300
        info := OrderedCollection new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7301
        result do:[:assoc |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7302
            info add:(assoc key , ' same as ' , assoc value)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7303
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7304
        info isEmpty ifTrue:[
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7305
            Dialog information:(resources string:'No duplicate files found.').
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  7306
            ^ self.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7307
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7308
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  7309
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7310
    stream := CharacterWriteStream new.
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7311
    stream nextPutAllLines:info.
5542
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7312
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7313
    textBox := TextBox new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7314
    textBox initialText:(stream contents).
5542
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7315
    stream close.
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7316
    textBox title:(resources string:'File duplicates in directory: %1' with:dir asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7317
    textBox readOnly:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7318
    textBox noCancel.
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7319
    textBox label:(resources string:'Duplicates in %1' with:dir asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7320
    maxLength := 10.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7321
    info do:[: el |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7322
        maxLength := maxLength max:(el size).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7323
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  7324
    textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false.
5542
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7325
    textBox maxExtent:Screen current extent.
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7326
    textBox openModeless.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  7327
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7328
    "Modified: / 27-07-2012 / 09:29:00 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7329
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7330
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7331
fileFindDuplicateFile
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7332
    "scan directory for duplicates of the selected files"
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7333
10306
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7334
    |files filesBySize samePerFile stream textBox mustHaveMatches|
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7335
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7336
    files := self currentSelectedFiles.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7337
    files isEmpty ifTrue:[^ self].
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7338
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7339
    self withWaitCursorDo:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7340
        filesBySize := Dictionary new.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7341
        files do:[:fn |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7342
            |sz entry|
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7343
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7344
            sz := fn asFilename fileSize.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7345
            (filesBySize at:sz ifAbsentPut:[Set new]) add:fn.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7346
        ].
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7347
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7348
        samePerFile := Dictionary new.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7349
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7350
        self currentSelectedDirectories do:[:eachDir |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7351
            eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7352
                eachFile isDirectory ifFalse:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7353
                    |sz possibleMatches|
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7354
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7355
                    sz := eachFile fileSize.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7356
                    possibleMatches := filesBySize at:sz ifAbsent:nil.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7357
                    possibleMatches notNil ifTrue:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7358
                        possibleMatches do:[:eachFileWithSameSize |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7359
                            eachFileWithSameSize ~= eachFile ifTrue:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7360
                                (eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7361
                                    (samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7362
                                ]
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7363
                            ]
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7364
                        ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7365
                    ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7366
                ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7367
            ]
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7368
        ].
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7369
    ].
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7370
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7371
    stream := CharacterWriteStream with:'Duplicates:'.
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7372
    (samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName])
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7373
    do:[:origFile |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7374
        |sameFiles|
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7375
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7376
        sameFiles :=  samePerFile at:origFile.
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7377
        stream nextPutLine:origFile baseName.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7378
        (sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName |
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7379
            stream nextPutAll:'    '; nextPutLine:eachSameName.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7380
        ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7381
    ].
10306
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7382
    stream nextPutLine:'Files without duplicates:'.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7383
    (samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName])
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7384
    do:[:origFile |
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7385
        |sameFiles|
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7386
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7387
        sameFiles :=  samePerFile at:origFile.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7388
        sameFiles isEmpty ifTrue:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7389
            stream nextPutLine:origFile baseName.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7390
        ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7391
    ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7392
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7393
    mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*').
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7394
    mustHaveMatches notEmptyOrNil ifTrue:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7395
        LastMustMatchPattern := mustHaveMatches.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7396
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7397
        stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7398
        (samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName])
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7399
        do:[:origFile |
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7400
            |sameFiles|
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7401
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7402
            sameFiles :=  samePerFile at:origFile.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7403
            sameFiles notEmpty ifTrue:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7404
                (sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7405
                    stream nextPutLine:origFile baseName.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7406
                ]
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7407
            ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7408
        ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7409
    ].
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7410
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7411
    textBox := TextBox new.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7412
    textBox initialText:(stream contents).
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7413
    textBox title:'Files with same contents'.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7414
    textBox readOnly:true.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7415
    textBox noCancel.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7416
    textBox extent:(350@400).
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7417
    textBox maxExtent:Screen current extent.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7418
    textBox openModeless. "/ showAtPointer.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7419
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7420
    "Created: / 11-07-2011 / 12:39:44 / cg"
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7421
!
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7422
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7423
fileFindDuplicates
321c1729db5b initial checkin
penk
parents:
diff changeset
  7424
    "scan directory for duplicate files"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7425
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7426
    |directories duplicates info 
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7427
     commonDir prefixSize stream titleStream textBox maxLength|
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7428
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7429
    directories := self currentSelectedDirectories.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7430
    duplicates := self class fileFindDuplicatesIn:directories.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7431
    duplicates isEmpty ifTrue:[
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7432
        Dialog information:'No duplicate files found.'.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7433
        ^ self.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7434
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7435
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7436
    info := OrderedCollection new.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7437
    commonDir := self getBestDirectory.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7438
    prefixSize := commonDir asString size.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7439
    duplicates do:[:assoc |
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7440
        |dup orig|
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7441
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7442
        dup := assoc key.
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7443
        orig := assoc value.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7444
        prefixSize > 1 ifTrue:[
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7445
            dup := dup pathNameRelativeFrom:commonDir.
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7446
            orig := orig pathNameRelativeFrom:commonDir.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7447
            "/ fn1 := ('..', (fn1 name copyFrom:(prefixSize + 1))).
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7448
            "/ fn2 := ('..', (fn2 copyFrom:(prefixSize + 1))).
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7449
        ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7450
        (dup includes:Character space) ifTrue:[
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7451
            dup := '"' , dup , '"'
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7452
        ].
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7453
        (orig includes:Character space) ifTrue:[
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7454
            orig := '"' , orig , '"'
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7455
        ].
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7456
        info add:(dup , ' duplicate of ' , orig)
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7457
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7458
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7459
    stream := CharacterWriteStream new.
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7460
    stream nextPutAllLines:info.
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7461
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7462
    titleStream := CharacterWriteStream with:'File duplicates in director'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7463
    directories size == 1 ifTrue:[
12602
a3610dbd8b96 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12497
diff changeset
  7464
        titleStream nextPutAll:'y: '; nextPutAll: directories first asString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7465
    ] ifFalse:[
4535
4df3f171bcb0 *** empty log message ***
penk
parents: 4534
diff changeset
  7466
        titleStream nextPutLine:'ies: '.
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7467
        directories do:[:dir|
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7468
            prefixSize > 1 ifTrue:[
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7469
                titleStream nextPutAll:'..'.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7470
                titleStream nextPutLine:((dir asString) copyFrom:(prefixSize + 1)).
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7471
            ] ifFalse:[
4535
4df3f171bcb0 *** empty log message ***
penk
parents: 4534
diff changeset
  7472
                titleStream nextPutLine:(dir asString).
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7473
            ].
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7474
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7475
    ].
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  7476
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7477
    textBox := TextBox new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7478
    textBox initialText:(stream contents).
321c1729db5b initial checkin
penk
parents:
diff changeset
  7479
    textBox title:(titleStream contents).
321c1729db5b initial checkin
penk
parents:
diff changeset
  7480
    textBox readOnly:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7481
    textBox noCancel.
14715
e806729125fc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14709
diff changeset
  7482
    stream := WriteStream on:''.
e806729125fc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14709
diff changeset
  7483
    stream nextPutAll:'Duplicates in '.
4170
d01b3e418209 *** empty log message ***
penk
parents: 4164
diff changeset
  7484
    directories do:[ :aDirectory |
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7485
        stream nextPutAll:aDirectory baseName.
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7486
        stream space.
4050
d63d33ad9c41 *** empty log message ***
penk
parents: 4046
diff changeset
  7487
    ].
4170
d01b3e418209 *** empty log message ***
penk
parents: 4164
diff changeset
  7488
    textBox label:stream contents.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7489
    maxLength := 10.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7490
    info do:[: el |
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7491
        maxLength := maxLength max:(el size).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7492
    ].
5092
1f44028f8fb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5082
diff changeset
  7493
    textBox extent:((maxLength * 5)@((info size max:40)* 10)).
1f44028f8fb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5082
diff changeset
  7494
    textBox maxExtent:Screen current extent.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7495
    textBox addButton:(Button 
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7496
                        label:(resources string:'Remove Duplicates')
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7497
                        action:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7498
                            (Dialog confirm:(resources string:'Remove %1 duplicate files?' with:duplicates size)) ifTrue:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7499
                                duplicates do:[:eachAssoc |
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7500
                                    eachAssoc key remove
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7501
                                ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7502
                            ].
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7503
                            textBox close.
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7504
                            self updateCurrentDirectoryWithReread.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7505
                        ]).
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7506
    textBox openModeless. "/ showAtPointer.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  7507
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7508
    "Modified: / 27-07-2012 / 09:29:14 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7509
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7510
321c1729db5b initial checkin
penk
parents:
diff changeset
  7511
fileFindFile
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7512
    |filename|
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7513
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7514
    filename := self firstSelectedFileName.
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7515
    filename isNil ifTrue:[
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  7516
        filename := Filename homeDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7517
    ].
4101
cc9cdc23b789 select & doubleClick
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  7518
    FindFileApplication openOnFileName:filename for:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7519
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7520
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7521
fileFindSimilarImages
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7522
    "scan directory for similar image files"
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7523
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7524
    |result stream textBox directories imageFiles histogramsV histogramsH 
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7525
     similarV similarH similar alreadyPrinted|
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7526
8524
cac6b19eae23 changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents: 8512
diff changeset
  7527
self withWaitCursorDo:[
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7528
    self withActivityIndicationDo:[
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7529
        result := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7530
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7531
        directories := self currentSelectedDirectories.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7532
        directories isEmpty ifTrue:[^ self].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7533
13714
d5583c9b5ddb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13704
diff changeset
  7534
        imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImageType].
8511
641332126a4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8510
diff changeset
  7535
        "/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo'].
641332126a4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8510
diff changeset
  7536
        imageFiles sort:[:a :b | a pathName < b pathName].
641332126a4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8510
diff changeset
  7537
        
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7538
        "/ for each, get the color histogram
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7539
        histogramsV := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7540
        histogramsH := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7541
        imageFiles do:[:fn |
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7542
            |hist image|
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7543
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7544
            image := Image fromFile:fn.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7545
            Transcript showCR:'generating histogram for ',fn baseName.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7546
            hist := ImageColorHistogram new forImage:image.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7547
            histogramsV at:fn put:(hist histogramVectorV).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7548
            histogramsH at:fn put:(hist histogramVectorH).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7549
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7550
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7551
        similarH := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7552
        similarV := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7553
        similar := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7554
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7555
        (self firstSelectedFile notNil
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7556
            ifTrue:[ Array with:self firstSelectedFile ]
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7557
            ifFalse:[ imageFiles ])
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7558
        do:[:eachFile1 |
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7559
            |setOfSimilar distancesV distancesH|
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7560
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7561
            distancesV := OrderedCollection new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7562
            distancesH := OrderedCollection new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7563
            setOfSimilar := OrderedCollection new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7564
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7565
            imageFiles do:[:eachFile2 |
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7566
                |v1 v2 dV dH|
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7567
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7568
                eachFile1 ~= eachFile2 ifTrue:[
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7569
                    v1 := histogramsV at:eachFile1.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7570
                    v2 := histogramsV at:eachFile2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7571
                    dV := ImageColorHistogram distanceFrom:v1 to:v2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7572
                    distancesV add:(eachFile2 -> dV).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7573
                    v1 := histogramsH at:eachFile1.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7574
                    v2 := histogramsH at:eachFile2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7575
                    dH := ImageColorHistogram distanceFrom:v1 to:v2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7576
                    distancesH add:(eachFile2 -> dH).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7577
                    (dV < 10000 and:[dH < 10000]) ifTrue:[
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7578
                        setOfSimilar add:eachFile2->(dV + dH).
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7579
                    ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7580
                ]
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7581
            ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7582
            distancesV sort:[:a1 :a2 | a1 value < a2 value].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7583
            distancesH sort:[:a1 :a2 | a1 value < a2 value].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7584
            similarV at:eachFile1 put:distancesV.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7585
            similarH at:eachFile1 put:distancesH.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7586
            setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7587
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7588
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7589
        similar isEmpty ifTrue:[
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7590
            Dialog information:'No similarities found.'.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7591
            ^ self.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7592
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7593
    ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7594
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7595
    stream := CharacterWriteStream new.
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7596
    alreadyPrinted := Set new.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7597
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7598
    imageFiles do:[:eachFile |
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7599
        |eachSet|
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7600
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7601
        (alreadyPrinted includes:eachFile) ifFalse:[
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7602
            eachSet := similar at:eachFile ifAbsent:nil.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7603
            eachSet notNil ifTrue:[
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7604
                stream nextPutLine:eachFile pathName.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7605
                eachSet do:[:info |
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7606
                    |fn2 dist|
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7607
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7608
                    fn2 := info key.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7609
                    dist := info value.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7610
                    stream nextPutAll:'    '.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7611
                    stream nextPutAll:fn2 pathName.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7612
                    stream nextPutLine:' (',dist printString,')'.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7613
                    alreadyPrinted add:fn2.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7614
                ].
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7615
                stream cr.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7616
            ].
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7617
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7618
    ].
8524
cac6b19eae23 changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents: 8512
diff changeset
  7619
    ].
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7620
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7621
    textBox := TextBox new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7622
    textBox initialText:(stream contents).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7623
    textBox title:'File similarities:'.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7624
    textBox readOnly:true.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7625
    textBox noCancel.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7626
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7627
    textBox label:'File similarities'.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7628
    textBox extent:(400@((similar size max:40)* 10)).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7629
    textBox maxExtent:Screen current extent.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7630
    textBox openModeless. "/ showAtPointer.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7631
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7632
    "Modified: / 25-07-2006 / 09:07:25 / cg"
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7633
!
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7634
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7635
fileHexDump
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  7636
    |file item|
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7637
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7638
    file := self firstSelectedFile.
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7639
    file notNil ifTrue:[
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7640
        item := DirectoryContentsBrowser itemClass fileName:file.
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  7641
        self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  7642
            applicationNamed:#FileApplicationNoteBook
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  7643
            ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item].
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7644
    ].
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  7645
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  7646
    "Modified (format): / 12-11-2017 / 11:19:56 / cg"
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7647
!
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7648
7324
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7649
fileIn:aFilename
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7650
    "fileIn a file"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7651
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7652
    self fileIn:aFilename lazy:false
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7653
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7654
    "Created: / 20-09-2006 / 14:30:06 / cg"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7655
!
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7656
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7657
fileIn:aFilename lazy:lazy
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7658
    "fileIn a file"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7659
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7660
    self withActivityIndicationDo:[
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7661
        self notify:('File in:', aFilename asFilename baseName).
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7662
        self singleFileFileIn:aFilename lazy:lazy.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7663
        self notify:nil.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7664
    ]
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7665
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7666
    "Created: / 20-09-2006 / 14:29:21 / cg"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7667
!
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7668
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7669
filterSelectedFiles:whichFilter
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7670
    |selectedFiles numFiles msg filterBlock|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7671
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  7672
    selectedFiles := self currentSelectedObjects.
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7673
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7674
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7675
    msg := 'Replace contents of file ''%2'' with output of %3-filter ?'.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7676
    numFiles > 1 ifTrue:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7677
        msg := 'Replace contents of %1 files with output of %3-filter ?'.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7678
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7679
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7680
    (Dialog 
6352
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7681
        confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter)
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7682
        initialAnswer:false
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7683
    ) ifFalse:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7684
        ^ self
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7685
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7686
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7687
    whichFilter == #rot13 ifTrue:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7688
        filterBlock := [:charIn | charIn rot13 ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7689
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7690
    "/ add more here...
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7691
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7692
    filterBlock isNil ifTrue:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7693
        self information:'No such filter: ' , whichFilter.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7694
        ^ self.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7695
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7696
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7697
    selectedFiles do:[:fileName |
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7698
        |s|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7699
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7700
        self notify:('Processing:',  fileName baseName).
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7701
        fileName isDirectory ifFalse:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7702
            [
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7703
                |inFile outFile in out|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7704
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7705
                inFile := fileName asFilename.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7706
                outFile := (fileName pathName , '.filter') asFilename.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7707
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7708
                [
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7709
                    |charIn charOut|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7710
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7711
                    in := inFile readStream.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7712
                    out := outFile writeStream.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7713
                    [in atEnd] whileFalse:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7714
                        charIn := in next.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7715
                        charOut := filterBlock value:charIn.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7716
                        out nextPut:charOut.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7717
                    ].
13683
e31bd21c4760 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13677
diff changeset
  7718
                    out close. out:= nil.
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7719
                    outFile renameTo:inFile.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7720
                ] ensure:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7721
                    out notNil ifTrue:[ out close ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7722
                    in notNil ifTrue:[ in close ].
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  7723
                    outFile remove.
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7724
                ]
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7725
            ] on:FileStream openErrorSignal do:[:ex|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7726
                self warn:('Cannot process "%1".' bindWith:fileName baseName allBold).
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7727
            ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7728
        ]
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7729
    ].
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  7730
    self notify:nil.
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  7731
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  7732
    "Modified: / 04-12-2006 / 13:14:48 / cg"
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7733
!
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7734
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7735
forEachParsedXmlFileDo:aBlock
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7736
    "parse all selected XML files, for each dom-tree, evaluate aBlock"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7737
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7738
    self withActivityIndicationDo:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7739
        | selectedFiles xmlDocument |
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7740
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7741
        selectedFiles:= self currentSelectedFiles.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7742
        selectedFiles do:[:fileName |
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7743
            XML::XMLSignal handle:[:ex |
14551
0fc5b67cdd3e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14530
diff changeset
  7744
                Dialog 
0fc5b67cdd3e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14530
diff changeset
  7745
                    information:('Error while reading XML:\    %1' bindWith:ex description) withCRs
0fc5b67cdd3e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14530
diff changeset
  7746
                    title:'XML Error'.
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7747
                ^ self.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7748
            ] do:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7749
                |s d magic encoder document|
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7750
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7751
                s := fileName asFilename readStream.
14012
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7752
                [
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7753
                    s binary.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7754
                    magic := (s next:2).
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7755
                    magic = #[254 255] ifTrue:[
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7756
                        "/ UTF16BE
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7757
                        document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7758
                    ] ifFalse:[ 
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7759
                        magic = #[255 254] ifTrue:[
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7760
                            "/ UTF16LE
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7761
                            document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7762
                        ].
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7763
                    ]. 
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7764
                ] ensure:[
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7765
                    s close.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7766
                ].
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7767
                document notNil ifTrue:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7768
                    xmlDocument := XML::XMLParser 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7769
                                    processDocumentString:document 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7770
                                    beforeScanDo:[:parse| parse validate:false].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7771
                ] ifFalse:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7772
                    xmlDocument := XML::XMLParser 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7773
                                    processDocumentInFilename:fileName 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7774
                                    beforeScanDo:[:parse| parse validate:false].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7775
                ]
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7776
            ].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7777
            aBlock value:xmlDocument.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7778
        ].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7779
    ]
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7780
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7781
    "Created: / 17-02-2011 / 13:58:21 / cg"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7782
!
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7783
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7784
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock 
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7785
    |numItems path files|
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7786
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7787
    files := self currentSelectedFiles.
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7788
    
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7789
    (numItems := files size) > 2 ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7790
        (self 
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7791
            confirm:(resources string:'Open for each of the %1 items ?' 
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7792
                                 with:numItems)) ifFalse:[^ self].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7793
    ].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7794
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7795
    self withActivityIndicationDo:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7796
        files do:[:fileName |
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7797
            (ignoreDirs not or:[fileName isDirectory not]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7798
                fileName isAbsolute ifTrue:[
17239
f09d9792751b #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17202
diff changeset
  7799
                    path := fileName name.
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7800
                ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7801
                    path := fileName pathName.
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7802
                ].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7803
                aBlock value:path
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7804
            ]
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7805
        ].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7806
    ].
17239
f09d9792751b #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17202
diff changeset
  7807
f09d9792751b #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17202
diff changeset
  7808
    "Modified: / 19-01-2017 / 16:57:03 / stefan"
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7809
!
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7810
8648
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7811
generateDetachedSignaturesForSelectedFiles
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7812
    "generate detached signature (pkcs7) files from the contents of the selected files.
16941
9edb5cb2922f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16911
diff changeset
  7813
     For Smalltalk text files, better use #generateSignaturesForSelectedFiles."
8648
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7814
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7815
    self withActivityIndicationDo:[
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7816
        self currentSelectedFiles do:[:fn |
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7817
            |data hash signature signatureFile|
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7818
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7819
            self notify:'Generating detached signature file for ', (fn baseName),'...'.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7820
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7821
            data := fn contentsAsString.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7822
            hash := SHA1Stream hashValueOf:data.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7823
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7824
            signature := Expecco::KeyFileGenerator new signExpeccoCode:hash.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7825
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7826
            signatureFile := fn addSuffix:'sig'.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7827
            signatureFile contents:signature.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7828
        ].
13677
1b97a31ac83f class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13521
diff changeset
  7829
        self updateCurrentDirectoryWithReread.
8648
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7830
        self notify:nil.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7831
    ]
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7832
!
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7833
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7834
generatePatchInstallerForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7835
    "generate an expecco patch, which installs the selected file(s).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7836
     Opens a dialog asking for the target directory and if the patch should be signed"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7837
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7838
    |dialog targetDirHolder targetDir 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7839
     generateSignedPatchHolder patchFileNameHolder patchFileName|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7840
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7841
    targetDirHolder := '.' asValue.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7842
    generateSignedPatchHolder := true asValue.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7843
    patchFileNameHolder := '/tmp/00nn_patchFile.st' asValue.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7844
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7845
    dialog := Dialog new.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7846
    dialog label:(resources string:'Patch Installer for File(s)').
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7847
    dialog addTextLabel:'Patchfile Name' adjust:#left.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7848
    dialog addInputFieldOn:patchFileNameHolder tabable:true.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7849
    dialog addTextLabel:'Target directory (relative to executable''s directory at execution time)' adjust:#left.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7850
    dialog addInputFieldOn:targetDirHolder tabable:true.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7851
    dialog addCheckBox:'Generate Signed Patch' on:generateSignedPatchHolder.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7852
    dialog addAbortAndOkButtons.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7853
    dialog open.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7854
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7855
    dialog accepted ifFalse:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7856
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7857
    targetDir := targetDirHolder value asFilename.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7858
    patchFileName := patchFileNameHolder value asFilename.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7859
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7860
    self withActivityIndicationDo:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7861
        |outStream zipArchive pkcs7SignedData signatureFilename|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7862
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7863
        self notify:'Generating self extracting st script: ', patchFileName name, '...'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7864
        outStream := patchFileName writeStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7865
        outStream nextPutAll:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7866
|patchStream zipArchive|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7867
patchStream := Expecco::Browser::CurrentPatchStreamQuery query.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7868
patchStream isNil ifTrue:[ self error:''sorry, this patch can only be installed in expecco 2.6.2 and newer (missing CurrentPatchStreamQuery)''].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7869
zipArchive := ZipArchive readingFrom:patchStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7870
zipArchive members do:[:each | zipArchive extract:each fileName].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7871
patchStream setToEnd. "/ to force fileIn to finish
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7872
!!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7873
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7874
!! !!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7875
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7876
'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7877
        zipArchive := ZipArchive writingTo:outStream. "/ newFileNamed:(patchFileName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7878
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7879
        self currentSelectedFiles do:[:fn |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7880
            |inStream signatureFilename|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7881
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7882
            inStream := fn asFilename readStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7883
            zipArchive addFile: (targetDir construct:fn asFilename baseName) name fromStream:inStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7884
            inStream close.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7885
        ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7886
16975
9c6630591fe6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 16941
diff changeset
  7887
        zipArchive close.
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7888
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7889
        generateSignedPatchHolder value ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7890
            self notify:'Generating signed file from: ', patchFileName name, '...'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7891
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7892
            pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:patchFileName contentsOfEntireFile.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7893
            signatureFilename := patchFileName withSuffix:'expeccoPatch'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7894
            signatureFilename contents:pkcs7SignedData.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7895
        ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7896
        self notify:nil.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7897
    ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7898
!
13783
00625eec40bc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13714
diff changeset
  7899
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7900
generateSignaturesForSelectedFiles
13783
00625eec40bc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13714
diff changeset
  7901
    "generate signed pkcs7 files from the contents of the selected files.
00625eec40bc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13714
diff changeset
  7902
     These can be delivered as expeccoPatch files"
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7903
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7904
    self withActivityIndicationDo:[
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7905
        self currentSelectedFiles do:[:fn |
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  7906
            |pkcs7SignedData signatureFilename|
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  7907
8646
8046120212f6 generating signed files
Stefan Vogel <sv@exept.de>
parents: 8645
diff changeset
  7908
            self notify:'Generating signed file from: ', (fn baseName), '...'.
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  7909
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  7910
            pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile.
12094
1ac25533a0d3 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12062
diff changeset
  7911
            signatureFilename := fn withSuffix:'expeccoPatch'.
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  7912
            signatureFilename contents:pkcs7SignedData.
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7913
        ].
13677
1b97a31ac83f class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13521
diff changeset
  7914
        self updateCurrentDirectoryWithReread.
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7915
        self notify:nil.
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7916
    ]
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7917
!
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  7918
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7919
inspectXmlFile
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7920
    "Show an XML file - either in an XMLInspector or fall back to
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7921
     a plain inspector on the XML tree"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7922
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7923
    self forEachParsedXmlFileDo:[:xmlDocument |
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7924
        XML::XMLInspector notNil ifTrue:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7925
            XML::XMLInspector openOn:xmlDocument.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7926
        ] ifFalse:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7927
            "fall back..."
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7928
            xmlDocument inspect.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7929
        ]
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7930
    ].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7931
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7932
    "Modified: / 17-02-2011 / 13:58:16 / cg"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7933
!
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7934
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7935
installAllAsAutoloaded
321c1729db5b initial checkin
penk
parents:
diff changeset
  7936
    "install all classes found here as autoloaded classes"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7937
9674
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7938
    self installAllAsAutoloadedRecursive:false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7939
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7940
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7941
installAllAsAutoloadedRecursive
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7942
    "install all classes found here and in subdirectories as autoloaded classes"
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7943
9674
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7944
    self installAllAsAutoloadedRecursive:true
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7945
!
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7946
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7947
installAllAsAutoloadedRecursive:aBoolean
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7948
    "install all classes found here (and in subdirs if aBoolean is true) as autoloaded classes"
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7949
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7950
    [
15507
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7951
        LoadInProgressQuery answerNotifyLoadingDo:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7952
            |installAction|
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7953
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7954
            installAction := 
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7955
                [:fn |
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7956
                    (fn suffix = 'st') ifTrue:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7957
                        self notify:('Install as autoloaded: ', fn baseName).
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7958
                        self installAsAutoloaded:fn.
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7959
                    ]
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7960
                ].
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7961
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7962
            self withActivityIndicationDo:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7963
                self currentSelectedDirectories do:[:dir|
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7964
                    aBoolean ifTrue:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7965
                        dir recursiveDirectoryContentsAsFilenamesDo:installAction
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7966
                    ] ifFalse:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7967
                        dir directoryContentsAsFilenamesDo:installAction
15152
d5f4755c217b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15111
diff changeset
  7968
                    ].
9674
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  7969
                ].
15507
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7970
                self notify:nil.
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7971
            ].
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  7972
        ]
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7973
    ] fork.
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7974
!
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  7975
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7976
installAsAutoloaded:aFilename
321c1729db5b initial checkin
penk
parents:
diff changeset
  7977
    "install aFilename as autoloaded class"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7978
13292
37cf92626327 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13232
diff changeset
  7979
    Smalltalk installAutoloadedClassFromSourceFile:aFilename
37cf92626327 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13232
diff changeset
  7980
37cf92626327 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13232
diff changeset
  7981
    "Modified: / 01-08-2013 / 16:58:09 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7982
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7983
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7984
joinSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7985
    |selectedFiles numFiles msg outFileName outFile outStream|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7986
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7987
    selectedFiles := self currentSelectedObjects.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7988
    (numFiles := selectedFiles size) <= 1 ifTrue:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7989
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7990
    msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7991
    outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7992
    outFileName isEmptyOrNil ifTrue:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7993
    outFile := selectedFiles first directory construct:outFileName.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7994
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7995
    outStream := outFile writeStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7996
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7997
    selectedFiles do:[:fileName |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7998
        self notify:('Adding:',  fileName baseName).
17997
03d094e11b46 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17982
diff changeset
  7999
        fileName readingFileDo:[:inStream |
03d094e11b46 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17982
diff changeset
  8000
            inStream copyToEndInto:outStream.
03d094e11b46 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17982
diff changeset
  8001
        ].
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8002
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8003
    outStream close.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8004
    self notify:nil.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8005
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8006
    "Modified: / 04-12-2006 / 13:15:10 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8007
!
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8008
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8009
loadImageThenDo:aBlock
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8010
    |img path files|
321c1729db5b initial checkin
penk
parents:
diff changeset
  8011
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8012
    files := self currentSelectedFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8013
    files isEmpty ifTrue:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8014
    files do:[:fileName |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8015
        path := fileName.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8016
        path isDirectory ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8017
            img := Image fromFile:(path pathName).
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8018
            img notNil ifTrue:[
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8019
                aBlock value:img
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8020
            ] ifFalse:[
15346
1220ca6a9666 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15259
diff changeset
  8021
                Dialog warn:(resources string:'Unknown image format: "%1"' with:fileName asString)
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8022
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8023
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8024
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8025
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8026
13089
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8027
loadSignatureSupport
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8028
    Expecco::KeyFileGenerator isNil ifTrue:[
14047
1bc0c67645f2 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 14012
diff changeset
  8029
        Smalltalk loadPackage:'exept:expecco/license'
13089
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8030
    ].
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8031
!
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8032
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8033
openASN1Browser
321c1729db5b initial checkin
penk
parents:
diff changeset
  8034
321c1729db5b initial checkin
penk
parents:
diff changeset
  8035
    self openTool:OSI::ASN1Browser 
321c1729db5b initial checkin
penk
parents:
diff changeset
  8036
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8037
321c1729db5b initial checkin
penk
parents:
diff changeset
  8038
openAppletViewer
321c1729db5b initial checkin
penk
parents:
diff changeset
  8039
    |numItems files|
321c1729db5b initial checkin
penk
parents:
diff changeset
  8040
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8041
    files := self currentSelectedFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8042
    (numItems := files size) > 2 ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8043
        (self 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8044
            confirm:(resources string:'open for each of the %1 items ?' 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8045
                                 with:numItems)) ifFalse:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8046
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8047
321c1729db5b initial checkin
penk
parents:
diff changeset
  8048
    Java startupJavaSystem.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8049
"/    Java markAllClassesUninitialized.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8050
"/    Java initAllStaticFields.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8051
"/    Java initAllClasses.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8052
321c1729db5b initial checkin
penk
parents:
diff changeset
  8053
    files do:[:fileName |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8054
        |p path|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8055
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8056
        path := fileName.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8057
        path isDirectory ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8058
            p := Java 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8059
                    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8060
                    argumentString:path pathName.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8061
            p resume.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8062
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8063
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8064
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8065
321c1729db5b initial checkin
penk
parents:
diff changeset
  8066
openCBrowser
6031
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8067
    |dir files|
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8068
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8069
    dir := self theSingleSelectedDirectoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8070
    dir isNil ifTrue:[ ^ self].
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8071
    self withActivityIndicationDo:[
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  8072
        files := self currentSelectedObjects.
6031
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8073
        files notEmptyOrNil ifTrue:[
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8074
            CBrowser::Browser openOn:files first.
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8075
        ] ifFalse:[
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8076
            CBrowser::Browser openIn:dir.
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8077
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8078
    ]
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8079
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  8080
    "Modified: / 04-12-2006 / 13:15:19 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8081
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8082
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8083
openChangeSetBrowser
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8084
    "open a changeSet browser on the selected file(s)"
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8085
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8086
    self
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8087
        openTool:(UserPreferences current changeSetBrowserClass) 
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8088
        with:#openOnFile: 
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8089
        ignoreDirectories:true
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8090
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8091
    "Modified (comment): / 27-07-2012 / 20:42:55 / cg"
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8092
!
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8093
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8094
openChangesBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  8095
    "open a change browser on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8096
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8097
    self currentSelectedDirectories notEmptyOrNil ifTrue:[
18248
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8098
        GitHubSmalltalkPackageReader notNil ifTrue:[
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8099
            self currentSelectedDirectories do:[:fn |
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8100
                (fn suffix = 'package') ifTrue:[
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8101
                    ChangeSetBrowser openOn:(GitHubSmalltalkPackageReader readPackageFrom:fn).
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8102
                ].    
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8103
                (fn suffix = 'class') ifTrue:[
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8104
                    ChangeSetBrowser openOn:(GitHubSmalltalkClassReader readClassFrom:fn).
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8105
                ].    
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8106
            ].
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8107
            ^ self.
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8108
        ].
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8109
    ].
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8110
    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8111
    self openTool:(UserPreferences current changesBrowserClass)
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8112
18248
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8113
    "Modified: / 30-06-2018 / 20:33:24 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8114
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8115
321c1729db5b initial checkin
penk
parents:
diff changeset
  8116
openDiffView
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8117
    "open a diff-view on the two selected files"
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8118
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8119
    |name1 name2 files title 
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8120
     defaultName defaultDir|
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8121
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8122
    files := self currentSelectedObjects.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8123
    files isEmpty ifTrue:[
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8124
        Dialog warn:(resources string:'You have to select a file first').
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8125
        ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8126
    ].
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8127
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8128
    (files size == 2) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8129
        name1 := files last.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8130
        name2 := files first.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8131
    ] ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8132
        LastFileDiffFile notNil ifTrue:[
11052
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8133
            LastFileDiffFile exists ifTrue:[
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8134
                name1 := LastFileDiffFile.
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8135
            ].
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8136
"/            | directory |
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8137
"/            directory := self currentDirectory.
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8138
"/            directory notNil ifTrue:[
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8139
"/                lastFile := directory asFilename construct:(LastFileDiffFile baseName).
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8140
"/                (lastFile exists and:[lastFile isReadable]) ifTrue:[
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8141
"/                    name1 := lastFile.
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8142
"/                ]
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8143
"/            ]
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8144
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8145
        name2 := files first.
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8146
        title := resources string:'Show differences between "%1" and:' with:name2 baseName.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8147
        defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil].
11052
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8148
        defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory].
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8149
        name1 := DialogBox 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8150
                    requestFileName:title 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8151
                    default:defaultName 
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8152
                    ok:(resources string:'OK') 
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8153
                    abort:(resources string:'Compare against File List') 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8154
                    pattern:'*' 
11052
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8155
                    fromDirectory:defaultDir.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8156
    ].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8157
    self openDiffViewOn:name1 and:name2
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8158
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8159
    "Modified: / 03-05-2012 / 08:03:16 / cg"
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8160
!
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8161
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8162
openDiffViewOn:fileArg1 and:fileArg2
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8163
    "open a diff-view on two files"
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8164
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8165
    |file1 file2 file1Size file2Size text1 text2 d err nm l1 sameContents msg|
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8166
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8167
    file1 := fileArg1.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8168
    file2 := fileArg2.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8169
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8170
    self withWaitCursorDo:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8171
        (file1 isNil or:[file1 asString isEmpty]) ifTrue:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8172
            text1 := self getAllFilesAsStrings asStringCollection withTabs.
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  8173
            text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l string]].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8174
            file1 := nil.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8175
            l1 := 'browser contents'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8176
        ] ifFalse:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8177
            file1 := file1 asFilename.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8178
            LastFileDiffFile := file1.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8179
            file1 isReadable ifFalse:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8180
                nm := file1.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8181
                file1 exists ifFalse:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8182
                    err := '"%1" does not exist.'.
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8183
                ] ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8184
                    err := '"%1" is not readable.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8185
                ].
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8186
            ].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8187
            l1 := file1 pathName
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8188
        ].
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8189
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8190
        err isNil ifTrue:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8191
            file2 isReadable ifFalse:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8192
                nm := file2.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8193
                file2 exists ifFalse:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8194
                    err := '"%1" does not exist.'.
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8195
                ] ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8196
                    err := '"%1" is not readable.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8197
                ].
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8198
            ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8199
        ].
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8200
        err notNil ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8201
            Dialog warn:(resources string:err with:nm pathName allBold).
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8202
            ^ self
6176
6bc0c44931c9 big file compare
Claus Gittinger <cg@exept.de>
parents: 6169
diff changeset
  8203
        ].
6bc0c44931c9 big file compare
Claus Gittinger <cg@exept.de>
parents: 6169
diff changeset
  8204
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8205
        self withActivityIndicationDo:[
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8206
            file1Size := file1 isNil ifTrue:[0] ifFalse:[file1 fileSize].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8207
            file2Size := file2 isNil ifTrue:[0] ifFalse:[file2 fileSize].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8208
            
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8209
            ((file1Size > (1024*1024*32)) or:[ file2Size > (1024*1024*32) ]) ifTrue:[
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8210
                file1Size = file2Size ifTrue:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8211
                    ProgressIndicator
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8212
                        displayBusyIndicator:'Comparing...'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8213
                        at:(Screen default center)
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8214
                        during:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8215
                            sameContents := (file1 sameContentsAs:file2).
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8216
                        ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8217
                    sameContents ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8218
                        self information:'Same contents.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8219
                    ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8220
                        self information:'Different contents (File(s) too big for more details).'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8221
                    ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8222
                ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8223
                    self information:'Different size (File(s) too big for more details).'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8224
                ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8225
                ^ self.
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8226
            ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8227
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8228
            file1 notNil ifTrue:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8229
                file1 isDirectory ifTrue:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8230
                    text1 := file1 directoryContents asString.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8231
                ] ifFalse:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8232
                    text1 := file1 contents.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8233
                ]
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8234
            ].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8235
            file2 isDirectory ifTrue:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8236
                text2 := file2 directoryContents asString.
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8237
            ] ifFalse:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8238
                text2 := file2 contents.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8239
            ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8240
            text1 = text2 ifTrue:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8241
                (file1 isDirectory or:[file2 isDirectory]) ifTrue:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8242
                    msg := 'Same filename lists.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8243
                ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8244
                    msg := 'Same contents.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8245
                ].
16911
d71609b50e6d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16825
diff changeset
  8246
                self information:msg
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8247
            ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8248
                d := DiffTextView 
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8249
                        openOn:text1 label:l1
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8250
                        and:text2 label:file2 pathName.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8251
                d topView label:(resources string:'File Differences').
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8252
            ]
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8253
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8254
    ]
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8255
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8256
    "Modified: / 19-11-2017 / 15:00:47 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8257
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8258
9496
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8259
openDirectoryDiffView
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8260
    "open a directory diff-view"
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8261
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8262
    |name1 name2 files|
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8263
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8264
    files := self currentSelectedObjects.
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8265
    files notEmpty ifTrue:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8266
        name1 := files first asFilename.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8267
        name1 asFilename isDirectory ifFalse:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8268
            name1 := name1 directory
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8269
        ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8270
    ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8271
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8272
    (files size == 2) ifTrue:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8273
        name2 := files second.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8274
    ] ifFalse:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8275
        (files size ~= 1) ifTrue:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8276
            Dialog warn:(resources string:'Please select one or two directories.').
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8277
            ^ self.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8278
        ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8279
        name2 := Dialog 
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8280
                    requestDirectoryName:(resources
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8281
                                            string:'Recursive compare "%1" with folder:' 
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8282
                                            with:name1 asFilename baseName)
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8283
                    default:(LastFileDiffDirectory ? self currentDirectory).
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8284
        name2 isEmptyOrNil ifTrue:[^ self].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8285
        LastFileDiffDirectory := name2.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8286
    ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8287
    name2 := name2 asFilename.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8288
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8289
    name2 asFilename isDirectory ifFalse:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8290
        name2 := name2 directory
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8291
    ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8292
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8293
    self 
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8294
        applicationNamed:#FileApplicationNoteBook
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8295
        ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2].
9496
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8296
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8297
    "Created: / 20-05-2010 / 15:01:17 / cg"
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8298
!
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8299
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8300
openEditor
321c1729db5b initial checkin
penk
parents:
diff changeset
  8301
    self openTool:EditTextView
321c1729db5b initial checkin
penk
parents:
diff changeset
  8302
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8303
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8304
openGV
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8305
    self openOSCommandWithFiles:'gv'
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8306
!
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8307
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8308
openHTMLReader
321c1729db5b initial checkin
penk
parents:
diff changeset
  8309
321c1729db5b initial checkin
penk
parents:
diff changeset
  8310
    self openTool:HTMLDocumentView ignoreDirectories:false
321c1729db5b initial checkin
penk
parents:
diff changeset
  8311
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8312
321c1729db5b initial checkin
penk
parents:
diff changeset
  8313
openImageEditor
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8314
    [
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8315
        self loadImageThenDo:[:img | img edit]
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8316
    ] fork
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8317
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8318
321c1729db5b initial checkin
penk
parents:
diff changeset
  8319
openImageInspector
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8320
    [
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8321
        self loadImageThenDo:[:img | img inspect]
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8322
    ] fork
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8323
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8324
321c1729db5b initial checkin
penk
parents:
diff changeset
  8325
openImagePreview
5778
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8326
    [
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8327
        self 
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8328
            loadImageThenDo:
5778
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8329
                [:img |
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8330
                    |i top viewer|
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8331
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8332
                    top := StandardSystemView new.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8333
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8334
                    viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8335
                    i := img.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8336
                    top extent:200@200.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8337
                    top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName).
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8338
                    top openAndWait.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8339
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8340
                    (i width > 200 or:[i height > 200]) ifTrue:[
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8341
                        i := i magnifiedPreservingRatioTo:200@200.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8342
                    ].
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8343
                    viewer image:i.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8344
                ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8345
    ] fork
321c1729db5b initial checkin
penk
parents:
diff changeset
  8346
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8347
321c1729db5b initial checkin
penk
parents:
diff changeset
  8348
openMP3Player
321c1729db5b initial checkin
penk
parents:
diff changeset
  8349
    |file|
321c1729db5b initial checkin
penk
parents:
diff changeset
  8350
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8351
    file := self currentSelectedFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8352
    (file isEmpty) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8353
        ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8354
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8355
    file := file first.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8356
    (MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8357
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8358
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8359
openOSCommandWithFiles:command
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8360
    |files fileNames|
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8361
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8362
    files := self currentSelectedFiles.
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8363
    (files isEmpty) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8364
        ^ self.
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8365
    ].
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8366
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8367
    fileNames := files collect:[:each |
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8368
                    '"' , each asFilename pathName , '"'
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8369
                 ].
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8370
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8371
    [
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8372
        OperatingSystem 
4959
Claus Gittinger <cg@exept.de>
parents: 4958
diff changeset
  8373
            executeCommand:command , ' ' , fileNames asStringCollection asString
Claus Gittinger <cg@exept.de>
parents: 4958
diff changeset
  8374
            inDirectory:(files first asFilename directory).
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8375
    ] fork
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8376
!
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8377
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8378
openPDFViewer
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8379
    |files fileNames cmd arg|
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8380
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8381
    files := self currentSelectedFiles.
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8382
    (files isEmpty) ifTrue:[
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8383
        ^ self.
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8384
    ].
12972
b7a2f930c5f2 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12963
diff changeset
  8385
    cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'.
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8386
    cmd isNil ifTrue:[
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8387
        Dialog warn:'No viewer has been defined for pdf-files (See MIMETypes initialization).'.
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8388
        ^ self.
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8389
    ].
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8390
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8391
    fileNames := 
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8392
        files 
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8393
            collect:
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8394
                [:each |
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8395
                    '"' , each asFilename pathName , '"'
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8396
                ].
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8397
    arg := fileNames asStringCollection asStringWith:' '.
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8398
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8399
    (cmd includesString:'"%1"') ifTrue:[
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8400
        cmd := cmd copyReplaceString:'"%1"' withString:'%1'    
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8401
    ].
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8402
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8403
    [
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8404
        OperatingSystem executeCommand:(cmd bindWith:arg).
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8405
    ] fork
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8406
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8407
    "Modified: / 12-05-2004 / 12:31:20 / cg"
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8408
!
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8409
4958
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8410
openRP
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8411
    self openOSCommandWithFiles:'realplay'
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8412
!
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8413
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8414
openResourceFileEditor
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8415
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8416
    self 
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8417
        openTool: Tools::InternationalLanguageTranslationEditor
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8418
        with: #openOnFile:
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8419
!
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8420
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8421
openSlideShow
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8422
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8423
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8424
    dir := self theSingleSelectedDirectoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8425
    dir isNil ifTrue:[^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8426
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8427
    CodingExamples_GUI::SlideShow openIn:dir.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8428
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8429
321c1729db5b initial checkin
penk
parents:
diff changeset
  8430
openSnapshotImageBrowser
4491
b5f8412a83e2 comments
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  8431
    "Sorry, for now, only the old browser can handle snapShotImages."
b5f8412a83e2 comments
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  8432
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8433
    ^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  8434
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8435
321c1729db5b initial checkin
penk
parents:
diff changeset
  8436
openTerminal
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8437
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8438
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8439
    dir := self theSingleSelectedDirectoryOrHomeDir.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8440
5300
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8441
    TerminalApplication notNil ifTrue:[
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8442
        TerminalApplication openIn:dir
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8443
    ] ifFalse:[
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8444
        VT100TerminalView openShellIn:dir.
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8445
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8446
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8447
321c1729db5b initial checkin
penk
parents:
diff changeset
  8448
openTool:aToolClass
321c1729db5b initial checkin
penk
parents:
diff changeset
  8449
    "open a tool on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8450
321c1729db5b initial checkin
penk
parents:
diff changeset
  8451
    ^ self openTool:aToolClass ignoreDirectories:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  8452
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8453
321c1729db5b initial checkin
penk
parents:
diff changeset
  8454
openTool:aToolClass ignoreDirectories:ignoreDirs
321c1729db5b initial checkin
penk
parents:
diff changeset
  8455
    "open a tool on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8456
321c1729db5b initial checkin
penk
parents:
diff changeset
  8457
    ^ self
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8458
        openTool:aToolClass 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8459
        with:#openOn: 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8460
        ignoreDirectories:ignoreDirs
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8461
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8462
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8463
openTool:aToolClass with:aSelector
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8464
    "open a tool on the selected file(s)"
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8465
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8466
    ^ self openTool:aToolClass with:aSelector ignoreDirectories:true
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8467
!
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8468
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8469
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs
321c1729db5b initial checkin
penk
parents:
diff changeset
  8470
    "open a tool on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8471
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8472
    |tool|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8473
321c1729db5b initial checkin
penk
parents:
diff changeset
  8474
    aToolClass isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8475
        Dialog warn:'Sorry, that tool seems to be not available'.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8476
        ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8477
    ].
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8478
    self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path |
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8479
        tool := aToolClass perform:aSelector with:path.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8480
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8481
    ^ tool
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8482
!
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8483
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8484
openWebBrowser
9343
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8485
    self 
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8486
        forEachSelectedFileIgnoringDirectories:true 
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8487
        do:[:path |
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8488
            Error
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8489
                handle:[:ex |
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8490
                    Dialog warn:'Shell execution failed: ',ex description
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8491
                ] do:[
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8492
                    OperatingSystem openApplicationForDocument:path operation:#open.
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8493
                    ^ self.
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8494
                ]
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8495
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8496
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8497
6022
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8498
openWorkspace
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8499
    self 
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8500
        openTool:WorkspaceApplication 
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8501
        with:#openOnFile:
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8502
        ignoreDirectories:true
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8503
!
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8504
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8505
openXV
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8506
    self openOSCommandWithFiles:'xv'
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8507
!
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8508
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8509
openZipTool
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8510
    |zipTool|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8511
321c1729db5b initial checkin
penk
parents:
diff changeset
  8512
    (zipTool := self openTool:ZipTool) notNil ifTrue:[
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8513
        zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8514
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8515
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8516
321c1729db5b initial checkin
penk
parents:
diff changeset
  8517
readAbbrevFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  8518
    "read the abbrev file and install classes found there as autoloaded classes"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8519
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8520
    |directories|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8521
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8522
    directories := self currentSelectedDirectories.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8523
    directories isEmpty ifTrue:[^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8524
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8525
    self withActivityIndicationDo:[
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8526
        directories do:[:eachDir |
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8527
            Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc').
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8528
        ]
5828
67b58a435b3e wait cursor
Claus Gittinger <cg@exept.de>
parents: 5810
diff changeset
  8529
    ]
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8530
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8531
    "Modified: / 25-07-2006 / 09:07:43 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8532
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8533
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8534
readAndShowResources
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8535
    self withActivityIndicationDo:[
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8536
        | selectedFiles|
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8537
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8538
        selectedFiles:= self currentSelectedFiles.
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8539
        selectedFiles do:[:fileName |
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8540
            resources := ResourcePack fromFile:fileName.
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8541
            resources inspect.
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8542
        ].
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8543
    ]
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8544
!
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8545
17831
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8546
removeBakAndSavFiles
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8547
    "remove all .sav and .bak files (after confirmation)"
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8548
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8549
    |filesToRemove directories|
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8550
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8551
    directories := self currentSelectedDirectories.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8552
    directories isEmptyOrNil ifTrue:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8553
        directories := Array with:self currentDirectory
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8554
    ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8555
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8556
    self withActivityIndicationDo:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8557
        filesToRemove := OrderedCollection new.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8558
        directories do:[:eachDirectoryToScan |
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8559
            eachDirectoryToScan filesDo:[:fn |
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8560
                (#('sav' 'bak') includes:fn suffix) ifTrue:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8561
                    filesToRemove add:fn.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8562
                ]
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8563
            ]
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8564
        ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8565
        filesToRemove isEmpty ifTrue:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8566
            Dialog information:(resources string:'Nothing to remove').
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8567
            ^ self.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8568
        ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8569
        (Dialog confirm:(resources string:'Remove %1 file(s) ?' with:filesToRemove size)) ifFalse:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8570
            ^ self
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8571
        ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8572
        filesToRemove do:[:each |
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8573
            each remove
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8574
        ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  8575
        self updateCurrentDirectoryWithReread
17831
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8576
    ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8577
!
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8578
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8579
singleFileFileIn:fileName lazy:lazy
321c1729db5b initial checkin
penk
parents:
diff changeset
  8580
    "fileIn the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8581
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8582
    |aStream wasLazy notifyString dontAskSignals lang|
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8583
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8584
    fileName isRegularFile ifFalse:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8585
        ^ self.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8586
    ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8587
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8588
    [
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8589
        (ObjectFileLoader notNil
5491
755cec01b183 Accept Filenames in loadFile:
Stefan Vogel <sv@exept.de>
parents: 5478
diff changeset
  8590
         and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8591
            AbortOperationRequest catch:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8592
                |p|
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8593
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8594
                "/
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8595
                "/ look if already loaded ...  then unload first
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8596
                "/
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8597
                p := fileName pathName.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8598
                (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8599
                    (Dialog confirm:(resources 
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8600
                                        string:'%1 is already loaded; load anyway ?'
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8601
                                        with:p)) ifFalse:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8602
                        ^ self
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8603
                    ].
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8604
                    notifyString := 'unloading old ' , p , ' ...'.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8605
                    Transcript showCR:notifyString.
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  8606
                    self notify:notifyString.
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8607
                    ObjectFileLoader unloadObjectFile:p. 
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8608
                ].
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8609
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8610
                notifyString := 'loading ' , p , ' ...'.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8611
                Transcript showCR:notifyString.
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  8612
                self notify:notifyString.
12426
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8613
                (ObjectFileLoader loadObjectFile:p) isNil ifTrue:[
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8614
                    notifyString := 'Error: could not load ' , p.
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8615
                    Transcript showCR:notifyString.
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8616
                    self notify:notifyString.
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8617
               ] ifFalse:[
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8618
                    Class addInfoRecord:('fileIn ' , fileName asFilename pathName) 
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8619
                ].
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8620
            ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8621
        ] ifFalse:[ ((fileName hasSuffix:'cls') 
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8622
                     and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8623
            "/ loading a binary class file
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  8624
            aStream := fileName readStreamOrNil.
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8625
            aStream notNil ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8626
                aStream fileInBinary.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8627
            ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8628
        ] ifFalse:[
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8629
            ((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8630
                "/ loading a java class file
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8631
                JavaClassReader notNil ifTrue:[
5491
755cec01b183 Accept Filenames in loadFile:
Stefan Vogel <sv@exept.de>
parents: 5478
diff changeset
  8632
                    JavaClassReader loadFile:fileName
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8633
                ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8634
            ] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8635
                "/ loading a sif (smalltalk interchange format) file
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8636
                SmalltalkInterchangeSTXFileInManager autoload.    
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8637
                SmalltalkInterchangeFileManager newForFileIn
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8638
                    fileName: fileName pathName;
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8639
                    fileIn.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8640
            ] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8641
                Parcel isNil ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8642
                    Dialog warn:'Parcel support not loaded.'
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8643
                ] ifFalse:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8644
                    Parcel loadParcelFrom: fileName pathName
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8645
                ]
13968
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8646
            ] ifFalse:[ (fileName hasSuffix:'jar') ifTrue:[
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8647
                JavaVM isNil ifTrue:[ 
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8648
                    Dialog warn: (resources string: 'Java support is not loaded.').
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8649
                    ^ self.
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8650
                ] ifFalse:[
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8651
                    JavaVM booted ifFalse:[ 
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8652
                        (Dialog confirm: (resources string: 'Java is not initialized. Initialize now?')) ifFalse:[ ^ self. ].
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8653
                        JavaVM boot.
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8654
                    ].
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8655
                    JavaVM loadClassesIn: fileName.  
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8656
                ]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8657
            ] ifFalse:[
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8658
                "/ ask programming languages...
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8659
                lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil.
14360
7459355f5a90 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14308
diff changeset
  8660
                (lang isNil and:[(fileName hasSuffix:'js')]) ifTrue:[
14362
b03192e7a145 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14360
diff changeset
  8661
                    Smalltalk loadPackage:'stx:libjavascript'.
14360
7459355f5a90 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14308
diff changeset
  8662
                    lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil.
7459355f5a90 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14308
diff changeset
  8663
                ].
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8664
                (lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8665
                    lang fileIn:fileName.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8666
                ] ifFalse:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8667
                    "/ loading a regular (chunk) or xml source file
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8668
                    Error handle:[:ex |
15675
ac6981afbb9b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15597
diff changeset
  8669
                        self errorNotify:'Error during file in: ', ex description.
15981
Stefan Vogel <sv@exept.de>
parents: 15936
diff changeset
  8670
                        ex resume.
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8671
                    ] do:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8672
                        aStream := fileName readStream.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8673
                        [
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8674
                            Class withoutUpdatingChangesDo:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8675
                                wasLazy := Compiler compileLazy:lazy.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8676
                                Smalltalk fileInStream:aStream.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8677
                            ].
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8678
                            Class addInfoRecord:('fileIn ' , fileName asString) 
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8679
                        ] ensure:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8680
                            Compiler compileLazy:wasLazy.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8681
                            aStream close
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8682
                        ]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8683
                    ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8684
                ]
13968
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8685
            ]]]]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8686
        ]]
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8687
    ] on:Error, HaltInterrupt, Class packageRedefinitionNotification do:[:ex| 
8082
40a926dc460d On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents: 8068
diff changeset
  8688
        |sig msg label labels values action proceedValue isRedef redefKind|
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8689
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8690
        isRedef := false.
12684
cc8a225600bd class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12602
diff changeset
  8691
        sig := ex creator.
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8692
        (dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8693
            action := #continue    
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8694
        ] ifFalse:[
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8695
            (sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8696
                ex reject
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8697
            ].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8698
            sig == Class methodRedefinitionNotification ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8699
                msg := 'trying to overwrite method:\\    ' , ex oldMethod whoString , '\\in package ''' 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8700
                       , ex oldPackage , ''' with method from package ''' , ex newPackage , ''''.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8701
                label := 'Method redefinition in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8702
                redefKind := 'method'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8703
                isRedef := true.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8704
            ] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8705
                msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8706
                       , ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8707
                label := 'Class redefinition in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8708
                redefKind := 'class'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8709
                isRedef := true.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8710
            ] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender|
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8711
                label := msg := 'Breakpoint/Halt in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8712
                sender := ex suspendedContext.
18264
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
  8713
                msg := msg , ('\\in %1 » %2' bindWith:(sender receiver class name) with:(sender sender selector))
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8714
            ] ifFalse:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8715
                label := 'Error in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8716
                msg := 'error in fileIn: %1'
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8717
            ]]].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8718
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8719
            msg := msg bindWith:ex description.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8720
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8721
            labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources').
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8722
            values := #(abort     skip  debug   compareSources).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8723
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8724
            isRedef ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8725
                  msg := msg, ('%<cr>%<cr>Continue will install the change and assign the %1 to the new package.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8726
    Keep Package will install the change, but keep the %1 in the old package.' bindWith:redefKind).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8727
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8728
                  labels := labels , #('Keep Package' ).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8729
                  values := values , #(keep).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8730
            ].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8731
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8732
            labels := labels , #( 'Continue' 'ContinueForAll').
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8733
            values := values , #(  continue   continueForAll).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8734
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8735
            AbortAllOperationWantedQuery query ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8736
                  labels := #('Cancel All') , labels.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8737
                  values := #(cancelAll) , values.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8738
            ].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8739
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8740
            action := Dialog 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8741
                          choose:(msg withCRs) 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8742
                          label:label
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8743
                          image:(WarningBox iconBitmap)
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8744
                          labels:labels
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8745
                          values:values
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8746
                          default:#continue
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8747
                          onCancel:#abort.
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8748
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8749
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8750
        action == #continueForAll ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8751
            dontAskSignals isNil ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8752
                dontAskSignals := IdentityDictionary new.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8753
            ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8754
            dontAskSignals at:sig put:#continue.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8755
            action := #continue.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8756
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8757
8887
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8758
        (action == #compareSources) ifTrue:[
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8759
            DiffCodeView 
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8760
                openOn:(ex oldMethod source) label:'Old Source'
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8761
                and:(ex newMethod source) label:'New Source'
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8762
                title:ex description.
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8763
            ex resignalAs:ex
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8764
        ].
8082
40a926dc460d On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents: 8068
diff changeset
  8765
        (action == #continue or:[action == #keep]) ifTrue:[
40a926dc460d On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents: 8068
diff changeset
  8766
            ex proceedWith:action "(isRedef ifTrue:[#keep] ifFalse:[#continue])".
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8767
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8768
        action == #abort ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8769
            AbortOperationRequest raise.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8770
            ex return
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8771
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8772
        action == #cancelAll ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8773
            AbortAllOperationRequest raise.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8774
            ex return
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8775
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8776
        action == #skip ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8777
            ex proceedWith:nil
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8778
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8779
        action == #debug ifTrue:[
7330
fe62e489caae When opening a debugger, make sure that the topmost context is returnable
Stefan Vogel <sv@exept.de>
parents: 7324
diff changeset
  8780
            Debugger enter:ex returnableSuspendedContext 
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8781
                     withMessage:ex description 
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8782
                     mayProceed:true.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8783
            ex proceedWith:nil.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8784
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8785
        ex reject
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8786
    ]
7040
19c639b3b68d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6952
diff changeset
  8787
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8788
    "Modified: / 22-11-2011 / 13:52:17 / cg"
13968
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8789
    "Modified: / 19-02-2014 / 12:49:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4531
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8790
!
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8791
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8792
splitFile:infile intoPiecesOfSize:kiloBytes
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8793
    |bytesPerSplit splitIndex bufferSize buffer n
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8794
     inStream outFile outStream remaining remainingInThisOutfile|
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8795
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8796
    bufferSize := 32*1024.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8797
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8798
    inStream := infile readStream.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8799
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8800
    bytesPerSplit := kiloBytes * 1024.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8801
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8802
    remaining := infile fileSize.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8803
    splitIndex := 1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8804
    [remaining > 0] whileTrue:[
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8805
        outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0).
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8806
        outStream := outFile asFilename writeStream.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8807
        remainingInThisOutfile := remaining min:bytesPerSplit.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8808
        [remainingInThisOutfile > 0] whileTrue:[
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8809
            buffer := ByteArray new:bufferSize.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8810
            n := inStream 
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8811
                    nextBytes:(bufferSize min:remainingInThisOutfile)
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8812
                    into:buffer 
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8813
                    startingAt:1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8814
            outStream nextPutBytes:n from:buffer startingAt:1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8815
            remainingInThisOutfile := remainingInThisOutfile - n.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8816
            remaining := remaining - n.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8817
        ].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8818
        outStream close.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8819
        splitIndex := splitIndex + 1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8820
    ].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8821
    inStream close.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8822
!
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8823
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8824
splitFile:infile intoPiecesWithNumberOfLines:numberOfLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8825
    |splitIndex line
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8826
     inStream outFile outStream remainingLinesInThisOutfile|
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8827
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8828
    inStream := infile readStream.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8829
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8830
    splitIndex := 1.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8831
    [inStream atEnd] whileFalse:[
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8832
        outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0).
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8833
        outStream := outFile asFilename writeStream.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8834
        remainingLinesInThisOutfile := numberOfLines.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8835
        [(remainingLinesInThisOutfile > 0) and:[inStream atEnd not]] whileTrue:[
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8836
            line := inStream nextLine.
15910
Claus Gittinger <cg@exept.de>
parents: 15906
diff changeset
  8837
            outStream nextPutLine:line.
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8838
            remainingLinesInThisOutfile := remainingLinesInThisOutfile - 1.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8839
        ].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8840
        outStream close.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8841
        splitIndex := splitIndex + 1.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8842
    ].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8843
    inStream close.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8844
!
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8845
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8846
splitSelectedFiles
6264
039dc5c1710b slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  8847
    |selectedFiles numFiles msg sizeString kiloBytes|
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8848
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  8849
    selectedFiles := self currentSelectedFiles.
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8850
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8851
6265
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  8852
    msg := (numFiles > 1) 
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  8853
                ifTrue:'Split each of the %1 files into pieces of size (in kB):'
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  8854
                ifFalse:'Split %2 into pieces of size (in kB):'.
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8855
6352
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  8856
    sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName).
6264
039dc5c1710b slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  8857
    sizeString isEmptyOrNil ifTrue:[^ self].
039dc5c1710b slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  8858
    kiloBytes := Integer readFrom:sizeString onError:nil.
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8859
    kiloBytes isNil ifTrue:[^ self].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8860
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8861
    selectedFiles do:[:fileName |
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8862
        self notify:('Splitting:',  fileName baseName).
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8863
        fileName isDirectory ifFalse:[
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8864
            self splitFile:fileName intoPiecesOfSize:kiloBytes.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8865
        ]
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8866
    ].
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  8867
    self notify:nil.
6265
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  8868
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  8869
    "Modified: / 04-12-2006 / 13:15:26 / cg"
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8870
!
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8871
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8872
splitSelectedFilesByLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8873
    |selectedFiles numFiles msg numLinesString numLines|
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8874
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8875
    selectedFiles := self currentSelectedFiles.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8876
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8877
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8878
    msg := (numFiles > 1) 
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8879
                ifTrue:'Split each of the %1 files into pieces with number of lines:'
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8880
                ifFalse:'Split %2 into pieces with number of lines:'.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8881
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8882
    numLinesString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName).
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8883
    numLinesString isEmptyOrNil ifTrue:[^ self].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8884
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8885
    numLines := Integer readFrom:numLinesString onError:nil.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8886
    numLines isNil ifTrue:[^ self].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8887
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8888
    selectedFiles do:[:fileName |
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8889
        self notify:('Splitting:',  fileName baseName).
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8890
        fileName isDirectory ifFalse:[
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8891
            self splitFile:fileName intoPiecesWithNumberOfLines:numLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8892
        ]
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8893
    ].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8894
    self notify:nil.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8895
!
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8896
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8897
truncateSelectedFilesToZeroSize
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8898
    |selectedFiles numFiles msg|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8899
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8900
    selectedFiles := self currentSelectedObjects.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8901
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8902
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8903
    msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8904
    numFiles > 1 ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8905
        msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8906
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8907
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8908
    (Dialog 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8909
        confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8910
        initialAnswer:false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8911
    ) ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8912
        ^ self
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8913
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8914
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8915
    selectedFiles do:[:fileName |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8916
        |s|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8917
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8918
        self notify:('Truncating:',  fileName baseName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8919
        fileName isDirectory ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8920
            [
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8921
                s := fileName writeStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8922
                s close.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8923
            ] on:FileStream openErrorSignal do:[:ex|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8924
                self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8925
            ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8926
        ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8927
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8928
    self notify:nil.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8929
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8930
    "Modified: / 04-12-2006 / 13:15:28 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8931
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8932
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  8933
!AbstractFileBrowser methodsFor:'menu queries-tools'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8934
321c1729db5b initial checkin
penk
parents:
diff changeset
  8935
anySTFilesPresent
321c1729db5b initial checkin
penk
parents:
diff changeset
  8936
    ^ self anyFilesPresentWithSuffix:'st'
321c1729db5b initial checkin
penk
parents:
diff changeset
  8937
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8938
321c1729db5b initial checkin
penk
parents:
diff changeset
  8939
canCreateNewProject
321c1729db5b initial checkin
penk
parents:
diff changeset
  8940
    self currentFilesAreInSameDirectory ifFalse:[^ false].
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  8941
    ^ self currentSelectedFiles 
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  8942
        contains:[:fileName| 
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  8943
            | suffix|
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  8944
            suffix := fileName suffix asLowercase.
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  8945
            (suffix = 'prj' or:[suffix = 'st'])
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  8946
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8947
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8948
321c1729db5b initial checkin
penk
parents:
diff changeset
  8949
canDoTerminal
321c1729db5b initial checkin
penk
parents:
diff changeset
  8950
321c1729db5b initial checkin
penk
parents:
diff changeset
  8951
    ^ OperatingSystem isUNIXlike
321c1729db5b initial checkin
penk
parents:
diff changeset
  8952
      or:[OperatingSystem isMSWINDOWSlike]
321c1729db5b initial checkin
penk
parents:
diff changeset
  8953
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8954
321c1729db5b initial checkin
penk
parents:
diff changeset
  8955
canDoTerminalAndSystemIsDOS
321c1729db5b initial checkin
penk
parents:
diff changeset
  8956
321c1729db5b initial checkin
penk
parents:
diff changeset
  8957
    ^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike]
321c1729db5b initial checkin
penk
parents:
diff changeset
  8958
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8959
321c1729db5b initial checkin
penk
parents:
diff changeset
  8960
canDoTerminalAndSystemIsUnix
321c1729db5b initial checkin
penk
parents:
diff changeset
  8961
321c1729db5b initial checkin
penk
parents:
diff changeset
  8962
    ^ self canDoTerminal and:[OperatingSystem isUNIXlike]
321c1729db5b initial checkin
penk
parents:
diff changeset
  8963
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8964
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8965
canGenerateSignatureFiles
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8966
    "we need the both the KeyFileGenerator (for the secret expecco key) and the KeyFile"
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8967
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8968
    Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ].
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8969
    Expecco::KeyFile isNil ifTrue:[ ^ false ].
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8970
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8971
    ^ self currentSelectedFiles notEmptyOrNil
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8972
!
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8973
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8974
canOpenMonticelloBrowser
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8975
    ^ self currentSelectedFiles
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8976
        contains:[:fileName|
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8977
            fileName suffix asLowercase = 'mcz'
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8978
        ]
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8979
!
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  8980
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8981
canReadAbbrevFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  8982
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  8983
    |currentDirectory|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8984
321c1729db5b initial checkin
penk
parents:
diff changeset
  8985
    self currentFilesAreInSameDirectory ifFalse:[^ false].
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  8986
    currentDirectory := self currentDirectory.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  8987
    ^ currentDirectory notNil 
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  8988
      and:[ (currentDirectory construct:'abbrev.stc') exists ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8989
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8990
321c1729db5b initial checkin
penk
parents:
diff changeset
  8991
canRemoveFromSourcePath
321c1729db5b initial checkin
penk
parents:
diff changeset
  8992
321c1729db5b initial checkin
penk
parents:
diff changeset
  8993
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  8994
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8995
13089
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8996
cannotGenerateSignatureFiles
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8997
    ^ self canGenerateSignatureFiles not
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8998
!
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8999
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9000
hasASN1
321c1729db5b initial checkin
penk
parents:
diff changeset
  9001
    ^ [ OSI::ASN1Parser notNil 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9002
        and:[OSI::ASN1Parser isLoaded]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9003
321c1729db5b initial checkin
penk
parents:
diff changeset
  9004
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9005
321c1729db5b initial checkin
penk
parents:
diff changeset
  9006
hasASN1AndSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9007
    ^ [ self hasSelection value 
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  9008
        and:[self currentSelectedFiles notEmptyOrNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9009
        and:[OSI::ASN1Parser notNil 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9010
        and:[OSI::ASN1Parser isLoaded]]]]
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  9011
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  9012
    "Modified: / 17-02-2017 / 08:25:09 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9013
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9014
321c1729db5b initial checkin
penk
parents:
diff changeset
  9015
hasCBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  9016
    ^ [ CBrowser::Browser notNil ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9017
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9018
321c1729db5b initial checkin
penk
parents:
diff changeset
  9019
hasJava
321c1729db5b initial checkin
penk
parents:
diff changeset
  9020
14298
dbcceba5f47e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14262
diff changeset
  9021
    ^ [ JavaVM notNil 
dbcceba5f47e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14262
diff changeset
  9022
        and:[JavaClassReader notNil 
dbcceba5f47e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14262
diff changeset
  9023
        and:[JavaClassReader isLoaded]]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9024
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9025
321c1729db5b initial checkin
penk
parents:
diff changeset
  9026
hasJavaAndSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9027
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9028
    ^ [ self currentSelectedFiles notEmptyOrNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9029
        and:[JavaClassReader notNil 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9030
        and:[JavaClassReader isLoaded]]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9031
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9032
321c1729db5b initial checkin
penk
parents:
diff changeset
  9033
hasMP3Player
321c1729db5b initial checkin
penk
parents:
diff changeset
  9034
321c1729db5b initial checkin
penk
parents:
diff changeset
  9035
    ^ [ MP3PlayerApplication notNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9036
        or:[SaugFix::MP3PlayerApplication notNil ]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9037
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9038
321c1729db5b initial checkin
penk
parents:
diff changeset
  9039
hasMP3PlayerAndSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9040
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9041
    ^ [ self currentSelectedFiles notEmptyOrNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9042
        and:[ self hasMP3Player value]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9043
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9044
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9045
hasResourceFileSelected
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9046
    ^ (self currentSelectedFiles) 
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9047
        contains:[:fn | 
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9048
            fn suffix asLowercase = 'rs'
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9049
        ].
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9050
!
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9051
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9052
hasSlideShow
321c1729db5b initial checkin
penk
parents:
diff changeset
  9053
321c1729db5b initial checkin
penk
parents:
diff changeset
  9054
    ^ [CodingExamples_GUI::SlideShow notNil]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9055
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9056
321c1729db5b initial checkin
penk
parents:
diff changeset
  9057
hasSnapshotSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9058
321c1729db5b initial checkin
penk
parents:
diff changeset
  9059
    ^ [ 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9060
        | files |
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9061
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9062
        files := self currentSelectedFiles.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9063
        ((files size == 1)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9064
        and:[ files first hasSuffix:'img' ])
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9065
      ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9066
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9067
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9068
hasXml
9206
7ed728324dbf changed: #hasXml
Claus Gittinger <cg@exept.de>
parents: 9173
diff changeset
  9069
    ^ [ XML::XMLParser notNil ]
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9070
!
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9071
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9072
hasXmlFileSelected
8611
3d979ab577b7 xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents: 8601
diff changeset
  9073
    "/ cg - no longer use this to enable XML-inspector (always enabled).
3d979ab577b7 xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents: 8601
diff changeset
  9074
    "/ then handle the error when it ever fails during xml-parsing.
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9075
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9076
    ^ [
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9077
        |sel fileName|
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9078
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9079
        sel := self currentSelectedFiles.
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9080
        sel size == 1 ifTrue:[
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9081
            fileName := sel first.
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9082
            fileName notNil ifTrue:[
15936
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  9083
                #('xml' 'xsd' 'vdx') includes:fileName suffix asLowercase
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9084
            ] ifFalse:[
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9085
                false
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9086
            ]
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9087
        ] ifFalse:[
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9088
            false
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9089
        ]
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9090
      ]
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9091
!
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9092
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9093
hasZipFileSelected
17982
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9094
    |sel fileName suff mime|
9764
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9095
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9096
    sel := self currentSelectedFiles.
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9097
    sel size == 1 ifFalse:[^ false].
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9098
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9099
    fileName := sel first.
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9100
    fileName isNil ifTrue:[^ false].
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9101
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9102
    suff := fileName suffix asLowercase.
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9103
    (suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true].
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9104
17982
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9105
    mime := fileName mimeTypeOfContents.
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9106
    "/ prepare for change (iana has obsoleted the x- types)
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9107
    ^ (mime = 'application/x-zip-compressed') or:[mime = 'application/zip']
9764
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9108
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9109
    "Modified: / 14-02-2011 / 17:17:03 / cg"
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9110
!
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9111
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9112
hasZipFileSelectedHolder
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9113
    ^ [ self hasZipFileSelected ]
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9114
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9115
    "Created: / 14-02-2011 / 17:16:08 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9116
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9117
321c1729db5b initial checkin
penk
parents:
diff changeset
  9118
javaSupportLoaded
321c1729db5b initial checkin
penk
parents:
diff changeset
  9119
321c1729db5b initial checkin
penk
parents:
diff changeset
  9120
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  9121
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9122
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  9123
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  9124
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9125
!AbstractFileBrowser methodsFor:'presentation'!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9126
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9127
getModeString:modeBits
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9128
    "convert file-mode bits into a more user-friendly string.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9129
     This is wrong here - should be moved into OperatingSystem."
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9130
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9131
    ^ self getModeString:modeBits 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9132
                    with:#( 'owner:' $r $w $x 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9133
                            ' group:' $r $w $x 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9134
                            ' others:' $r $w $x )
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9135
!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9136
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9137
getModeString:modeBits with:texts
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9138
    "convert file-mode bits into a more user-friendly string.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9139
     This is wrong here - should be moved into OperatingSystem."
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9140
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9141
    |bits modeString|
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9142
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9143
    bits := modeBits bitAnd:8r777.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9144
    modeString := ''.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9145
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9146
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9147
    with: texts do:[:bitMask :access |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9148
        |ch|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9149
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9150
        bitMask isNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9151
            modeString := modeString , access
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9152
        ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9153
            (bits bitAnd:bitMask) == 0 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9154
                ch := $-
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9155
            ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9156
                ch := access
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9157
            ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9158
            modeString := modeString copyWith:ch 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9159
        ]
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9160
    ].
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9161
    ^ modeString
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9162
! !
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9163
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9164
!AbstractFileBrowser methodsFor:'private'!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9165
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9166
theSingleSelectedDirectoryOrHomeDir
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9167
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9168
5888
f2758e87cb4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5883
diff changeset
  9169
    dir := self theSingleSelectedDirectoryOrNil.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9170
    dir isNil ifTrue:[ dir := Filename homeDirectory].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9171
    ^ dir.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9172
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9173
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9174
theSingleSelectedDirectoryOrNil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9175
    |dirs|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9176
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9177
    dirs := self currentSelectedDirectories.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9178
    dirs size ~= 1 ifTrue:[ ^ nil].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9179
    ^ dirs anElement.
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9180
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9181
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9182
theSingleSelectedFileOrNil
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9183
    |dirs|
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9184
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9185
    dirs := self currentSelectedFiles.
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9186
    dirs size ~= 1 ifTrue:[ ^ nil].
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9187
    ^ dirs anElement.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9188
! !
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9189
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9190
!AbstractFileBrowser methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9191
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9192
cBrowserLoaded
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9193
    ^ CBrowser::Browser notNil
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9194
!
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9195
10747
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9196
cBrowserMenuItemVisible
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9197
    ^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ]
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9198
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9199
    "Created: / 04-10-2011 / 13:40:38 / cg"
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9200
!
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9201
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9202
getAllFilesAsStrings
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9203
    "raise an error: must be redefined in concrete subclass(es)"
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9204
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9205
    ^ self subclassResponsibility
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9206
!
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9207
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9208
getFileInfoStringForFirstSelectedFile:longInfo
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9209
    "get stat info on selected file - return a string which can be
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9210
     shown in a box"
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9211
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9212
    |selFiles filename fileOutput modeBits modeString s info
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9213
     sizeString fileSize tAccess tModification buffer|
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9214
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9215
    selFiles := self currentSelectedObjects.
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9216
    selFiles size ~~ 1 ifTrue:[ ^ nil].
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9217
    filename := selFiles first.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9218
8364
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9219
    info := filename linkInfo.
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9220
    info isNil ifTrue:[
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9221
        ^ 'Cannot get fileInfo'.
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9222
        ^ nil
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9223
    ].
8364
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9224
5755
5e8165d55605 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 5753
diff changeset
  9225
    buffer := Text writeStream.
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9226
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9227
    buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9228
        nextPutAll:'filename: '; 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9229
        nextPutLine:filename asString.
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9230
8364
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9231
    OperatingSystem isMSDOSlike ifTrue: [
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9232
        (info alternativeName notNil
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9233
        and:[ info alternativeName ~= info fullName ]) ifTrue:[
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9234
            buffer nextPutAll:'shortname: '.
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9235
            buffer nextPutLine:info alternativeName.
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9236
        ]
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9237
    ].
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9238
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9239
    buffer nextPutAll:'type:   '.
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9240
    info isSymbolicLink ifTrue:[
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9241
        filename exists ifFalse:[
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9242
            buffer nextPutAll:'broken '.
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9243
        ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9244
        buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9245
            nextPutAll:'symbolic link to: ';
7633
0a85c590f98f ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents: 7585
diff changeset
  9246
            nextPutLine:(info path ? '???').
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9247
    ] ifFalse:[
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9248
        (longInfo and:[info isRegular]) ifTrue:[
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9249
            fileOutput := filename fileType.
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9250
        ].
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9251
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9252
        fileOutput isNil ifTrue:[
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9253
            s := info type asString
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9254
        ] ifFalse:[
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9255
            s := 'regular (' , fileOutput , ')'
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9256
        ].
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9257
        buffer nextPutLine:s.
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9258
    ].
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9259
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9260
    fileSize := info fileSize.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9261
    sizeString := 'size:   ', fileSize printString.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9262
    longInfo ifTrue:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9263
        fileSize > 1024  ifTrue:[
8172
71054e80bac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8168
diff changeset
  9264
            sizeString := sizeString,' (',(UnitConverter fileSizeStringFor:fileSize),')'.
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9265
        ].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9266
    ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9267
    buffer nextPutLine:sizeString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9268
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9269
    modeBits := info mode.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9270
    modeString := self getModeString:modeBits.
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9271
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9272
    buffer nextPutAll:'access: '; nextPutAll:modeString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9273
    longInfo ifTrue:[
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9274
        buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$).
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9275
    ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9276
    buffer
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9277
        cr;
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9278
        nextPutAll:'owner:  ';
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9279
        nextPutLine:(OperatingSystem getUserNameFromID:(info uid)).
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9280
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9281
    longInfo ifTrue:[
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9282
        buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9283
            nextPutAll:'group:  ';
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9284
            nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)).
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9285
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9286
        tAccess := info accessTime.
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9287
        buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9288
            nextPutAll:'last access:       '; 
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9289
            nextPutAll:tAccess asDate printString; 
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9290
            space;
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9291
            nextPutLine:tAccess asTime printString.
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9292
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9293
        tModification := info modificationTime.
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9294
        buffer 
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9295
            nextPutAll:'last modification: '; 
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9296
            nextPutAll:tModification asDate printString; 
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9297
            space;
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9298
            nextPutLine:tModification asTime printString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9299
    ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9300
    ^ buffer contents
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9301
7633
0a85c590f98f ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents: 7585
diff changeset
  9302
    "Modified: / 07-02-2007 / 10:38:14 / cg"
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9303
!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9304
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9305
hasImageColorHistogram
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9306
    ^ ImageColorHistogram notNil
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9307
!
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9308
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9309
hasImageHistogram
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9310
    ^ ImageAlgorithms notNil
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9311
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9312
    "Created: / 10-09-2017 / 16:50:34 / cg"
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9313
!
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9314
10258
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9315
hasSubversionSupport
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  9316
    ^ ConfigurableFeatures includesFeature: #SubversionSupport
10258
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9317
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9318
    "Created: / 24-06-2010 / 19:59:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10678
3a574f143d8f changed: #hasSubversionSupport
Claus Gittinger <cg@exept.de>
parents: 10669
diff changeset
  9319
    "Modified: / 07-09-2011 / 10:41:19 / cg"
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  9320
    "Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10258
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9321
!
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9322
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9323
initialCommandFor:fileName into:aBox
321c1729db5b initial checkin
penk
parents:
diff changeset
  9324
    "set a useful initial command for execute box."
321c1729db5b initial checkin
penk
parents:
diff changeset
  9325
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  9326
    self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9327
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9328
321c1729db5b initial checkin
penk
parents:
diff changeset
  9329
isAbstractFileBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  9330
321c1729db5b initial checkin
penk
parents:
diff changeset
  9331
    ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  9332
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9333
321c1729db5b initial checkin
penk
parents:
diff changeset
  9334
systemIsDOS
321c1729db5b initial checkin
penk
parents:
diff changeset
  9335
    ^ OperatingSystem isMSDOSlike
321c1729db5b initial checkin
penk
parents:
diff changeset
  9336
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9337
12473
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9338
systemIsOSX
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9339
    ^ OperatingSystem isOSXlike
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9340
!
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9341
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9342
systemIsUnix
321c1729db5b initial checkin
penk
parents:
diff changeset
  9343
    ^ OperatingSystem isUNIXlike
14980
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9344
!
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9345
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9346
systemSupportsVolumes
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9347
    ^ OperatingSystem supportsVolumes
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9348
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9349
321c1729db5b initial checkin
penk
parents:
diff changeset
  9350
!AbstractFileBrowser methodsFor:'queries-file'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9351
321c1729db5b initial checkin
penk
parents:
diff changeset
  9352
allItemsOfCurrentDirectory
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9353
    self 
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  9354
        applicationNamed:#DirectoryContentsBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9355
        ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9356
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9357
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9358
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9359
321c1729db5b initial checkin
penk
parents:
diff changeset
  9360
anyFilesPresentWithSuffix:suffix
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  9361
    self currentSelectedDirectories do:[:dir|
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  9362
        [
5810
4661bf4c3bbf openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents: 5789
diff changeset
  9363
            (dir directoryContentsAsFilenamesDo:[:fn | (fn suffix = suffix) ifTrue:[ ^ true]])
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  9364
        ] on:FileStream openErrorSignal do:[:ex|].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9365
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9366
    ^ false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9367
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9368
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9369
commonPrefixOfSelectedFiles
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9370
    |selFiles stringCol firstPre|
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9371
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9372
    selFiles := self currentSelectedObjects.
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9373
    selFiles isEmpty ifTrue:[^ nil].
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9374
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9375
    stringCol := selFiles collect:#asString.
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9376
    firstPre := stringCol at:1.
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9377
    stringCol from:2 do:[:el|
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9378
         firstPre := firstPre commonPrefixWith:el.
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9379
    ].
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9380
    ^ firstPre asFilename
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9381
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9382
    "Modified: / 04-12-2006 / 13:14:25 / cg"
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9383
!
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9384
12481
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9385
compressTabsOnSave
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9386
    "if true, compress leading spaces (multiples of 8) with a tab character
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9387
     when saving.
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9388
     Default is true"
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9389
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9390
    ^ true
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9391
!
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9392
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9393
currentFilesAreInSameDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  9394
4881
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9395
    ^ self parentDirectoriesOfCurrentFiles size < 2
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9396
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9397
321c1729db5b initial checkin
penk
parents:
diff changeset
  9398
currentFilesHasDirectories
321c1729db5b initial checkin
penk
parents:
diff changeset
  9399
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  9400
    ^ self currentSelectedDirectories notEmpty.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9401
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9402
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9403
directoriesForFiles:aFileCol
11743
acb7245e126b changed:
Stefan Vogel <sv@exept.de>
parents: 11712
diff changeset
  9404
     ^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set.
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9405
!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9406
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9407
fileListIsEmpty
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9408
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9409
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9410
        ifPresentDo:[:appl | ^ appl fileListIsEmpty].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9411
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9412
    ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9413
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9414
321c1729db5b initial checkin
penk
parents:
diff changeset
  9415
fileListIsNotEmpty
321c1729db5b initial checkin
penk
parents:
diff changeset
  9416
321c1729db5b initial checkin
penk
parents:
diff changeset
  9417
    ^ self fileListIsEmpty not.   
321c1729db5b initial checkin
penk
parents:
diff changeset
  9418
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9419
321c1729db5b initial checkin
penk
parents:
diff changeset
  9420
fileName:aFilename1 startsWith:aFilename2
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9421
    " check if aFilename2 is a prefix of aFilename1"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9422
321c1729db5b initial checkin
penk
parents:
diff changeset
  9423
    | file1 file2 |
321c1729db5b initial checkin
penk
parents:
diff changeset
  9424
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9425
    (aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9426
    file1 := aFilename1 asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9427
    file2 := aFilename2 asFilename.
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9428
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9429
    file2 isRootDirectory ifTrue:[ ^ true].
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9430
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9431
    ((file1 isDirectory) 
321c1729db5b initial checkin
penk
parents:
diff changeset
  9432
    and:[(file2 isDirectory)
321c1729db5b initial checkin
penk
parents:
diff changeset
  9433
    and:[file1 directory = file2 directory]]) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9434
        ^ file1 baseName = file2 baseName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9435
    ].
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9436
    ^ (file1 pathName) startsWith:(file2 pathName)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9437
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9438
321c1729db5b initial checkin
penk
parents:
diff changeset
  9439
getAllFilesAsStringCollection
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9440
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9441
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9442
        ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9443
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9444
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9445
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9446
321c1729db5b initial checkin
penk
parents:
diff changeset
  9447
getBestDirectory
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  9448
    "from a set of directories, return the common parent directory"
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  9449
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  9450
    ^ self class getBestDirectoryFrom:(self currentSelectedDirectories)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9451
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9452
321c1729db5b initial checkin
penk
parents:
diff changeset
  9453
getDirWithoutFileName:aFileName
321c1729db5b initial checkin
penk
parents:
diff changeset
  9454
321c1729db5b initial checkin
penk
parents:
diff changeset
  9455
    | dir |
321c1729db5b initial checkin
penk
parents:
diff changeset
  9456
    aFileName isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9457
        ^ aFileName.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9458
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9459
    dir := aFileName asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9460
    dir isDirectory ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9461
        dir := dir directory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9462
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9463
    ^ dir.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9464
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9465
321c1729db5b initial checkin
penk
parents:
diff changeset
  9466
getInfoItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  9467
    "get filename of a description-file (.dir.info, README etc.);
16778
dbbfdadc87a8 #OTHER by mawalch
mawalch
parents: 16732
diff changeset
  9468
     This file is automatically shown when a directory is entered.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9469
     You can add more names below if you like."
321c1729db5b initial checkin
penk
parents:
diff changeset
  9470
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9471
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9472
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9473
    dir := self theSingleSelectedDirectoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9474
    dir isNil ifTrue:[ ^ nil].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9475
16778
dbbfdadc87a8 #OTHER by mawalch
mawalch
parents: 16732
diff changeset
  9476
    #(
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9477
       '.dir.info'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9478
       'README'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9479
       'ReadMe'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9480
       'Readme'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9481
       'readme'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9482
       'read.me'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9483
       'Read.me'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9484
       'READ.ME'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9485
       'README.TXT'
15915
08316e965232 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15910
diff changeset
  9486
       'README.txt'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9487
       'readme.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9488
       'Readme.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9489
       'Info.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9490
       'info.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9491
       'INFO.TXT'
15915
08316e965232 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15910
diff changeset
  9492
       'INFO.txt'
16778
dbbfdadc87a8 #OTHER by mawalch
mawalch
parents: 16732
diff changeset
  9493
    ) do:[:f |
5883
a13bd841136b dir declaration error in getInfoItem
penk
parents: 5880
diff changeset
  9494
        |n|
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9495
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9496
        n := dir construct:f.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9497
        (n isReadable and:[n isDirectory not]) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9498
            ^ DirectoryContentsBrowser itemClass fileName:n
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9499
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9500
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9501
    ^ nil
4881
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9502
!
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9503
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9504
hasPackageDirectorySelected
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9505
    |dir|
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9506
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9507
    dir := self currentDirectory.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9508
    ^  dir notNil
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9509
    and:[ dir exists
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9510
    and:[ (dir / 'abbrev.stc') exists ]]
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9511
!
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9512
4881
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9513
parentDirectoriesOfCurrentFiles
11743
acb7245e126b changed:
Stefan Vogel <sv@exept.de>
parents: 11712
diff changeset
  9514
    ^ self currentSelectedObjects 
acb7245e126b changed:
Stefan Vogel <sv@exept.de>
parents: 11712
diff changeset
  9515
        collect:[:file | file directory] as:Set
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9516
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9517
    "Modified: / 04-12-2006 / 13:15:21 / cg"
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  9518
!
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  9519
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  9520
recursiveAnyFilesPresentWithSuffix:suffix
6652
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9521
    ^ true. "/ the code below is too slow for a menu enabling operation
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9522
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9523
"/    |directories|
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9524
"/
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9525
"/    directories := self currentDirectories value.
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9526
"/    directories do:[:dir|
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9527
"/        [
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9528
"/            dir recursiveDirectoryContentsDo:[:f |
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9529
"/                (f asFilename suffix = suffix) ifTrue:[ ^ true]
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9530
"/            ]
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9531
"/        ] on:FileStream openErrorSignal do:[:ex|].
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9532
"/    ].
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9533
"/    ^ false.
6586
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9534
!
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9535
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9536
recursiveAnySTFilesPresent
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9537
    ^ self recursiveAnyFilesPresentWithSuffix:'st'
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9538
! !
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9539
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9540
!AbstractFileBrowser methodsFor:'selection'!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9541
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9542
currentSelectedDirectories
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  9543
    ^ self currentDirectoriesValue.
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9544
!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9545
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9546
currentSelectedFiles
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9547
    ^ self currentSelectedObjects reject:#isDirectory.
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9548
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9549
    "Modified: / 04-12-2006 / 13:14:39 / cg"
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9550
!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9551
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9552
currentSelectedObjects
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9553
    ^ self currentFileNameHolder value 
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9554
!
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9555
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9556
firstSelectedFile
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9557
    ^ self currentSelectedObjects 
12102
9512a4336434 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12094
diff changeset
  9558
        detect:[:file | (file ? '') asFilename isDirectory not]
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9559
        ifNone:[].
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9561
    "Modified: / 04-12-2006 / 13:14:50 / cg"
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9562
!
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9563
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9564
hasOnlyDirectoriesSelected
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9565
    ^ self currentSelectedObjects conform:[:file | file isDirectory].
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9566
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9567
    "Created: / 20-05-2010 / 10:45:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9568
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9569
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9570
hasOnlyFilesSelected
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9571
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9572
    ^ self currentSelectedObjects conform:[:file | file isDirectory not].
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9573
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9574
    "Modified: / 04-12-2006 / 13:15:01 / cg"
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9575
!
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9576
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9577
hasTwoDirectoriesSelected
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9578
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9579
    ^ self currentSelectedObjects size == 2 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9580
        and:[self hasOnlyDirectoriesSelected]
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9581
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9582
    "Created: / 20-05-2010 / 10:45:18 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9583
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9584
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9585
hasTwoFilesSelected
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9586
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9587
    ^ self currentSelectedObjects size == 2 
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9588
        and:[self hasOnlyFilesSelected]
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9589
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9590
    "Modified: / 04-12-2006 / 13:15:04 / cg"
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9591
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9592
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9593
selectNextFile
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9594
    self 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9595
        applicationNamed:#DirectoryContentsBrowser 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9596
        ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectNextFile ]].
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9597
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9598
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9599
selectPreviousFile
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9600
    self 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9601
        applicationNamed:#DirectoryContentsBrowser 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9602
        ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectPreviousFile ]].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9603
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9604
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9605
!AbstractFileBrowser methodsFor:'sorting'!
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9606
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9607
currentSortOrder
17790
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9608
    ^ self 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9609
        aspectFor:#currentSortOrder 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9610
        ifAbsent:[ 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9611
            (Dictionary new
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9612
                at:#column put:nil;
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9613
                at:#reverse put:false;
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9614
                at:#sortCaseless put:false;
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9615
                yourself
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9616
            ) asValue 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9617
        ].
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9618
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9619
    "Modified: / 25-11-2017 / 17:43:00 / cg"
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9620
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9621
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9622
sortBlockHolder
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9623
    ^ self aspectFor:#sortBlockHolder ifAbsent:[
5383
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9624
        (FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9625
                    selector:#fileName 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9626
                    sortCaseless:self sortCaseless value 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9627
                    sortReverse:false) asValue.
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9628
    ].
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9629
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9630
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9631
sortBlockProperty
6785
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9632
    |v|
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9633
    
6785
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9634
    v := self aspectFor:#sortBlockProperty ifAbsent:[ #baseName asValue ].
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9635
    v addDependent:self.
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9636
    ^ v.
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9637
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9638
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9639
sortCaseless
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  9640
    " aspect for sort caseless "
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9641
13000
e3df0150a620 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12972
diff changeset
  9642
    ^ self 
e3df0150a620 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12972
diff changeset
  9643
        aspectFor:#sortCaseless 
e3df0150a620 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12972
diff changeset
  9644
        ifAbsent:[ (Filename isCaseSensitive not) asValue ]
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9645
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9646
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9647
sortDirectoriesBeforeFiles
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9648
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  9649
    " aspect for sort directories always before files"
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9650
    ^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ].
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9651
!
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9652
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9653
sortFileListsBy:instanceName 
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9654
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9655
    self sortFileListsBy:instanceName withReverse:true
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9656
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9657
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9658
sortFileListsBy:instanceName withReverse:aBoolean
8994
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
  9659
    | aSymbol sortCaselessLocal currentSortOrder sorter isReverse|
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9660
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9661
    aSymbol := instanceName asSymbol.
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9662
    self sortBlockProperty setValue:instanceName asSymbol.
4151
950e04fef4ba treeBrowser has his own sort now
penk
parents: 4148
diff changeset
  9663
    sortCaselessLocal := self sortCaseless value.
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9664
    currentSortOrder := self currentSortOrder value.
17790
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9665
7841
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9666
    currentSortOrder isEmptyOrNil ifTrue:[
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9667
        self currentSortOrder value:(currentSortOrder := Dictionary new).
4343
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9668
        currentSortOrder at:#column put:aSymbol.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9669
        currentSortOrder at:#reverse put:false.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9670
        currentSortOrder at:#sortCaseless put:sortCaselessLocal.
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9671
    ] ifFalse:[
4343
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9672
        (currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9673
            "/ sort caseless changed
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9674
            currentSortOrder at:#sortCaseless put:sortCaselessLocal.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9675
        ] ifFalse:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9676
            (currentSortOrder at:#column) = aSymbol ifTrue:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9677
                "/ same column like before - change sort order ifReverse is true
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9678
                aBoolean ifTrue:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9679
                    isReverse := currentSortOrder at:#reverse.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9680
                    currentSortOrder at:#reverse put:(isReverse not).
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9681
                ].
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9682
            ] ifFalse:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9683
                "/ another column - remark column
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9684
                currentSortOrder at:#column put:aSymbol.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9685
            ]
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9686
        ]
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9687
    ].
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9688
    self currentSortOrder changed.
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9689
5383
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9690
    sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9691
                            selector:instanceName 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9692
                            sortCaseless:sortCaselessLocal 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9693
                            sortReverse:(currentSortOrder at:#reverse).
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9694
    self sortBlockHolder value:sorter.
7841
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9695
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9696
    "Modified: / 18-09-2007 / 09:42:47 / cg"
17790
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9697
    "Modified (format): / 25-11-2017 / 17:43:31 / cg"
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9698
! !
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9699
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9700
!AbstractFileBrowser methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9701
16720
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9702
initializeAspects
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9703
    aspects := IdentityDictionary new.
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9704
    aspects at:#applications put:(IdentityDictionary new).
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9705
!
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9706
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9707
makeDependent
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9708
    self filterModel addDependent:self.            
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9709
    self currentFileNameHolder addDependent:self.
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9710
    self sortDirectoriesBeforeFiles addDependent:self.
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9711
    self sortCaseless addDependent:self.
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  9712
    self showHiddenFiles addDependent:self.
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  9713
    self rootHolder addDependent:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9714
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9715
321c1729db5b initial checkin
penk
parents:
diff changeset
  9716
masterApplication:anApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  9717
321c1729db5b initial checkin
penk
parents:
diff changeset
  9718
    masterApplication isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9719
        (anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9720
            aspects := anApplication aspects
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9721
        ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9722
            aspects isNil ifTrue:[
16721
c4ac29c3d146 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 16720
diff changeset
  9723
                self initializeAspects.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9724
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9725
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9726
        self applications at:(self className) put:self.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9727
"/        self makeDependent.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9728
    ].
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9729
    ^ super masterApplication:anApplication.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9730
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9731
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9732
postBuildWith:aBuilder
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9733
    self makeDependent.
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9734
    super postBuildWith:aBuilder.
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9735
!
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9736
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9737
postOpenWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  9738
321c1729db5b initial checkin
penk
parents:
diff changeset
  9739
    super postOpenWith:aBuilder.
14655
29c914f5fede class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14604
diff changeset
  9740
    "/ now done for all windowGroups by the group itself
29c914f5fede class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14604
diff changeset
  9741
    "/ self windowGroup showWaitCursorWhenBusyForMillis:100.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  9742
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  9743
    "Modified: / 25-07-2006 / 09:12:45 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9744
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9745
321c1729db5b initial checkin
penk
parents:
diff changeset
  9746
!AbstractFileBrowser::Clipboard methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9747
321c1729db5b initial checkin
penk
parents:
diff changeset
  9748
files
321c1729db5b initial checkin
penk
parents:
diff changeset
  9749
    "return the value of the instance variable 'files' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9750
321c1729db5b initial checkin
penk
parents:
diff changeset
  9751
    ^ files
321c1729db5b initial checkin
penk
parents:
diff changeset
  9752
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9753
321c1729db5b initial checkin
penk
parents:
diff changeset
  9754
files:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  9755
    "set the value of the instance variable 'files' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9756
321c1729db5b initial checkin
penk
parents:
diff changeset
  9757
    files := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9758
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9759
321c1729db5b initial checkin
penk
parents:
diff changeset
  9760
method
321c1729db5b initial checkin
penk
parents:
diff changeset
  9761
    "return the value of the instance variable 'method' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9762
321c1729db5b initial checkin
penk
parents:
diff changeset
  9763
    ^ method
321c1729db5b initial checkin
penk
parents:
diff changeset
  9764
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9765
321c1729db5b initial checkin
penk
parents:
diff changeset
  9766
method:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  9767
    "set the value of the instance variable 'method' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9768
321c1729db5b initial checkin
penk
parents:
diff changeset
  9769
    method := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9770
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9771
321c1729db5b initial checkin
penk
parents:
diff changeset
  9772
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9773
321c1729db5b initial checkin
penk
parents:
diff changeset
  9774
locked
321c1729db5b initial checkin
penk
parents:
diff changeset
  9775
    "return the value of the instance variable 'locked' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9776
321c1729db5b initial checkin
penk
parents:
diff changeset
  9777
    locked isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9778
        locked := false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9779
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9780
    ^ locked
321c1729db5b initial checkin
penk
parents:
diff changeset
  9781
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9782
321c1729db5b initial checkin
penk
parents:
diff changeset
  9783
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9784
321c1729db5b initial checkin
penk
parents:
diff changeset
  9785
doIfUnLocked:aBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
  9786
321c1729db5b initial checkin
penk
parents:
diff changeset
  9787
    self locked ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9788
        aBlock value.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9789
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9790
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9791
321c1729db5b initial checkin
penk
parents:
diff changeset
  9792
doLocked:aBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
  9793
321c1729db5b initial checkin
penk
parents:
diff changeset
  9794
    locked  := true.
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9795
    aBlock ensure:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9796
        locked := false.
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9797
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9798
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9799
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9800
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9801
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9802
defaultHistorySize
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9803
    ^ 50
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9804
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9805
6371
b5dab61da244 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6370
diff changeset
  9806
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'!
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9807
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9808
new
6371
b5dab61da244 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6370
diff changeset
  9809
    ^ (super new) initializeHistory.
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9810
! !
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9811
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9812
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'!
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9813
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9814
historySize
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9815
    historySize isNil ifTrue:[^ self class defaultHistorySize].
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9816
    ^ historySize
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9817
!
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9818
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9819
historySize:aNumber
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9820
    historySize := aNumber
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9821
! !
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9822
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9823
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9824
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9825
addToHistory:aPath
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
  9826
    | item pathToAdd sep|
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9827
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9828
    pathToAdd := aPath.
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
  9829
    (pathToAdd endsWith:(sep := Filename separator)) ifTrue:[
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9830
        pathToAdd asFilename isRootDirectory ifFalse:[
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
  9831
            pathToAdd := pathToAdd copyButLast:(sep asString size).    
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9832
        ]    
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9833
    ].
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9834
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9835
    item := self getItemFor:pathToAdd.
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9836
    self backForwardListAdd:pathToAdd.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9837
    item isNil ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9838
        " not already in history"
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9839
        self size >= self historySize ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9840
            self removeLast.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9841
        ].
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
  9842
        item := DirectoryHistoryItem path:pathToAdd.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9843
    ] ifFalse:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9844
        "already been there before; move the entry to
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9845
         the beginning, so it will fall out later."
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9846
        self remove:item.
10381
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
  9847
    ].
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
  9848
    self addFirst:item
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
  9849
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
  9850
    "Modified: / 24-07-2011 / 07:12:54 / cg"
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9851
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9852
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9853
backForwardListAdd:aPath
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9854
    |pathIndex|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9855
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9856
    pathIndex := backForwardList indexOf:aPath.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9857
    pathIndex == 0 ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9858
        " a new path comes in remove forward paths "
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9859
        (backForwardList size) > backForwardIndex ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9860
            backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size).    
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9861
        ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9862
    ] ifFalse:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9863
        backForwardList remove:aPath.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9864
        pathIndex <= backForwardIndex ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9865
            backForwardIndex := backForwardIndex - 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9866
        ]
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9867
    ].
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9868
    backForwardList add:aPath afterIndex:backForwardIndex.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9869
    backForwardIndex := backForwardIndex + 1.
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9870
    backForwardIndex > self historySize ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9871
        backForwardList removeFirst.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9872
        backForwardIndex := backForwardIndex - 1.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9873
    ].
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9874
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9875
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9876
goBackward
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9877
    "return the first path of the backward list;
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9878
     remove it from the back list and add it ti the forward list."
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9879
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9880
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9881
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9882
    self canBackward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9883
        retPath := backForwardList at:(backForwardIndex - 1).
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9884
        backForwardIndex := backForwardIndex - 1.
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9885
    ].
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9886
    ^ retPath.
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9887
!
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9888
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9889
goForward
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9890
    "return the first path of the forward list;
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9891
     remove it from the list."
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9892
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9893
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9894
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9895
    self canForward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9896
        retPath := backForwardList at:backForwardIndex + 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9897
        backForwardIndex := backForwardIndex + 1.
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9898
    ].
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9899
    ^ retPath.
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9900
!
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9901
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9902
resetForwardBackward
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9903
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9904
    self initialize
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9905
!
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9906
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9907
setPosition:aPosition for:aPath
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9908
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9909
    self do:[:item| 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9910
        item path = aPath ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9911
            item position:aPosition.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9912
        ]
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  9913
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9914
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9915
4870
8e9a999939d3 method category rename
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
  9916
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'!
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9917
6371
b5dab61da244 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6370
diff changeset
  9918
initializeHistory
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9919
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9920
    backForwardList := OrderedCollection new.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9921
    self reverseDo:[:el|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9922
        backForwardList add:el path.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9923
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9924
    backForwardIndex := backForwardList size.
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9925
! !
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9926
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9927
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9928
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9929
canBackward
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9930
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9931
    ^ backForwardIndex > 1 
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9932
!
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  9933
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9934
canForward
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9935
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9936
    ^ (backForwardList size >= (backForwardIndex + 1))
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9937
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9938
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9939
getBackCollection
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9940
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9941
    | backCol |
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9942
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9943
    backCol := OrderedCollection new.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9944
    self canBackward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9945
        | tmpCol |
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9946
        tmpCol := backForwardList copyTo:backForwardIndex - 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9947
        tmpCol reverseDo:[ :el|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9948
            backCol add:el.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9949
        ]
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9950
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9951
    ^ backCol
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9952
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9953
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9954
getForwardCollection
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9955
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9956
    | forwCol |
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9957
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9958
    forwCol := OrderedCollection new.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9959
    self canForward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9960
        forwCol := backForwardList copyFrom:(backForwardIndex + 1)    
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9961
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9962
    ^ forwCol
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9963
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9964
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9965
getItemFor:aPath
6627
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9966
    ^ self detect:[:item| item path = aPath] ifNone:nil.
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9967
"/    self do:[:item| item path = aPath ifTrue:[^ item]].
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9968
"/    ^ nil.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9969
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9970
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9971
getPositionFor:aPath
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9972
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9973
    |item|
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9974
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9975
    item := self getItemFor:aPath.
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9976
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9977
    item notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9978
        ^ item position.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9979
    ].
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9980
    ^ nil
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9981
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9982
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9983
includesPath:aPath
6627
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9984
    ^ self contains:[:item | item path = aPath].
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9985
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9986
"/    self do:[:item| item path = aPath ifTrue:[^ true]].
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  9987
"/    ^ false.
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9988
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9989
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9990
nextBackwardItem
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9991
    "return the first path of the backward list"
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9992
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9993
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9994
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9995
    self canBackward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9996
        retPath := backForwardList at:backForwardIndex.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9997
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9998
    ^ retPath.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  9999
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10000
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10001
nextForwardItem
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10002
    "return the first path of the forward list"
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10003
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10004
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10005
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10006
    self canForward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10007
        retPath := backForwardList at:backForwardIndex + 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10008
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10009
    ^ retPath.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10010
! !
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10011
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10012
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10013
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10014
path:aPath
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10015
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10016
    ^ self new path:aPath
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10017
! !
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10018
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10019
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10020
6433
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10021
asFilename
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10022
    ^ path asFilename
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10023
!
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10024
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10025
path
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10026
    "return the value of the instance variable 'path' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10027
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10028
    ^ path
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10029
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10030
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10031
path:something
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10032
    "set the value of the instance variable 'path' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10033
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10034
    path := something.
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10035
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10036
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10037
position
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10038
    "return the value of the instance variable 'position' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10039
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10040
    ^ position
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10041
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10042
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10043
position:something
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10044
    "set the value of the instance variable 'position' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10045
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10046
    position := something.
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10047
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10048
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10049
printString
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10050
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10051
    ^ self path asString
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10052
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10053
321c1729db5b initial checkin
penk
parents:
diff changeset
 10054
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10055
321c1729db5b initial checkin
penk
parents:
diff changeset
 10056
withValue:aValue isHolder:aBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
 10057
321c1729db5b initial checkin
penk
parents:
diff changeset
 10058
    | instance |
321c1729db5b initial checkin
penk
parents:
diff changeset
 10059
321c1729db5b initial checkin
penk
parents:
diff changeset
 10060
    instance := self basicNew.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10061
    instance value:aValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10062
    instance isHolder:aBoolean.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10063
    ^ instance
321c1729db5b initial checkin
penk
parents:
diff changeset
 10064
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10065
321c1729db5b initial checkin
penk
parents:
diff changeset
 10066
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10067
321c1729db5b initial checkin
penk
parents:
diff changeset
 10068
isHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
 10069
    "return the value of the instance variable 'isHolder' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10070
321c1729db5b initial checkin
penk
parents:
diff changeset
 10071
    ^ isHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
 10072
!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10073
321c1729db5b initial checkin
penk
parents:
diff changeset
 10074
isHolder:something
321c1729db5b initial checkin
penk
parents:
diff changeset
 10075
    "set the value of the instance variable 'isHolder' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10076
321c1729db5b initial checkin
penk
parents:
diff changeset
 10077
    isHolder := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10078
!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10079
321c1729db5b initial checkin
penk
parents:
diff changeset
 10080
value
321c1729db5b initial checkin
penk
parents:
diff changeset
 10081
    "return the value of the instance variable 'value' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10082
321c1729db5b initial checkin
penk
parents:
diff changeset
 10083
    ^ value
321c1729db5b initial checkin
penk
parents:
diff changeset
 10084
!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10085
321c1729db5b initial checkin
penk
parents:
diff changeset
 10086
value:something
321c1729db5b initial checkin
penk
parents:
diff changeset
 10087
    "set the value of the instance variable 'value' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10088
321c1729db5b initial checkin
penk
parents:
diff changeset
 10089
    value := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10090
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10091
321c1729db5b initial checkin
penk
parents:
diff changeset
 10092
!AbstractFileBrowser class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10093
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
 10094
version
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10095
    ^ '$Header$'
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
 10096
!
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
 10097
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
 10098
version_CVS
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10099
    ^ '$Header$'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10100
! !
12094
1ac25533a0d3 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12062
diff changeset
 10101