AbstractFileBrowser.st
author Stefan Vogel <sv@exept.de>
Fri, 17 May 2019 17:11:44 +0200
changeset 18767 0478d93cdb75
parent 18751 387323a6f3b4
child 18770 307cc2ff113f
permissions -rw-r--r--
#REFACTORING by stefan Sanitize BlockValues class: Tools::Inspector2 changed: #toolbarBackgroundHolder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
     1
"{ Encoding: utf8 }"
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
     2
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     3
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     4
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     5
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     6
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     7
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
     8
 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
     9
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    10
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    11
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    12
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    13
"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    14
"{ Package: 'stx:libtool' }"
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
"{ NameSpace: Smalltalk }"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    17
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    18
ApplicationModel subclass:#AbstractFileBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    19
	instanceVariableNames:'aspects'
16720
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    20
	classVariableNames:'CommandHistory CommandHistorySize DefaultCommandPerSuffix
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    21
		DefaultFilters DirectoryBookmarks LastEnforcedNameSpace
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    22
		LastFileDiffDirectory LastFileDiffFile LastFileSelection
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
    23
		LastMercurialRepository LastMoveDestination LastMustMatchPattern
18609
8e78a084139c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18578
diff changeset
    24
		LastScriptBlockString MaxFileSizeShownWithoutAsking RootHolder
8e78a084139c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18578
diff changeset
    25
		RuntimeAspects VisitedDirectories'
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    26
	poolDictionaries:''
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    27
	category:'Interface-Tools-File'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
    28
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    29
321c1729db5b initial checkin
penk
parents:
diff changeset
    30
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage'
321c1729db5b initial checkin
penk
parents:
diff changeset
    31
321c1729db5b initial checkin
penk
parents:
diff changeset
    32
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    33
 The following class instance variables are inherited by this class:
321c1729db5b initial checkin
penk
parents:
diff changeset
    34
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    35
	ApplicationModel - ClassResources
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    36
	Model - 
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    37
	Object - 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    38
"
321c1729db5b initial checkin
penk
parents:
diff changeset
    39
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    40
321c1729db5b initial checkin
penk
parents:
diff changeset
    41
Object subclass:#Clipboard
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    42
	instanceVariableNames:'method files'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    43
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    44
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    45
	privateIn:AbstractFileBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    46
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    47
321c1729db5b initial checkin
penk
parents:
diff changeset
    48
Object subclass:#CodeExecutionLock
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    49
	instanceVariableNames:'locked'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    50
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    51
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    52
	privateIn:AbstractFileBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    53
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    54
4366
97a0311a9539 *** empty log message ***
penk
parents: 4358
diff changeset
    55
List subclass:#DirectoryHistory
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    56
	instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    57
		backForwardList backForwardIndex historySize'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    58
	classVariableNames:'HistorySize'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    59
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    60
	privateIn:AbstractFileBrowser
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
    61
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
    62
c04d4781a37e next stage
penk
parents: 3949
diff changeset
    63
Object subclass:#DirectoryHistoryItem
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    64
	instanceVariableNames:'path position'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    65
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    66
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    67
	privateIn:AbstractFileBrowser::DirectoryHistory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    68
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    69
321c1729db5b initial checkin
penk
parents:
diff changeset
    70
Object subclass:#SaveAspectItem
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    71
	instanceVariableNames:'value isHolder'
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    72
	classVariableNames:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    73
	poolDictionaries:''
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
    74
	privateIn:AbstractFileBrowser
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
    75
!
321c1729db5b initial checkin
penk
parents:
diff changeset
    76
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    77
!AbstractFileBrowser class methodsFor:'documentation'!
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
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    80
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    81
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    82
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    83
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    84
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    85
 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
    86
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    87
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    88
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    89
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
    90
"
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    91
!
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
documentation
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    94
"
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    95
    [Author:]
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
    96
        Christian Penk
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    97
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
    98
    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
    99
    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
   100
    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
   101
    and as a container is almost incomprehensable...
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   102
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   103
    [class variables:]
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   104
        CommandHistory 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   105
        CommandHistorySize 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   106
        DefaultCommandPerSuffix
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   107
        DefaultFilters 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   108
        DirectoryBookmarks 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   109
        LastEnforcedNameSpace
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   110
        LastFileDiffDirectory 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   111
        LastFileDiffFile 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   112
        LastFileSelection
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   113
        LastMercurialRepository 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   114
        LastMoveDestination 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   115
        LastMustMatchPattern
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   116
        LastScriptBlockString 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   117
        RootHolder 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   118
        RuntimeAspects
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   119
        VisitedDirectories 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   120
        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
   121
                                            to be shown. This number (if non-nil) suppresses this
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   122
                                            question for files smaller.
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   123
                                            The initial default is 1Mb (1024*1024)
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5963
diff changeset
   124
"
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5122
diff changeset
   125
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   126
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   127
!AbstractFileBrowser class methodsFor:'accessing'!
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   128
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   129
currentSelection
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   130
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   131
    LastFileSelection isNil ifTrue:[
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
    ].
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   134
    ^ LastFileSelection
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   135
!
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   136
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   137
currentSelection:aFilenameCol
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
   138
    aFilenameCol notEmptyOrNil ifTrue:[
12102
9512a4336434 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12094
diff changeset
   139
        LastFileSelection := aFilenameCol collect:[:file | (file ? '') asFilename]
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
   140
    ]
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   141
!
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   142
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   143
directoryHistory
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   144
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   145
    VisitedDirectories isNil ifTrue:[
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   146
        VisitedDirectories := self directoryHistoryClass new.
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   147
        "/ VisitedDirectories inspect.
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
    ^ VisitedDirectories
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   150
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   151
    "Modified: / 21-11-2012 / 08:45:49 / cg"
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   152
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   153
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   154
maxFileSizeShownWithoutAsking
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   155
    "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
   156
     part should be shown"
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
    ^ MaxFileSizeShownWithoutAsking ? (1024*1024)
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
    "Created: / 19-11-2017 / 14:48:19 / cg"
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   161
!
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   162
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   163
maxFileSizeShownWithoutAsking:anIntegerOrNilForDefault
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   164
    "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
   165
     part should be shown.
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   166
     Nil resets to the default (currently 1Mb)"
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   167
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   168
    MaxFileSizeShownWithoutAsking := anIntegerOrNilForDefault
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   169
17769
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
     self maxFileSizeShownWithoutAsking:nil
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   172
    "
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
   173
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   174
    "Created: / 19-11-2017 / 14:48:45 / cg"
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   175
!
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
   176
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   177
resetClassVars
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   178
    VisitedDirectories := nil.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
   179
    LastFileSelection := nil.
5936
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   180
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   181
    "
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   182
     AbstractFileBrowser resetClassVars
795ea70b2c64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5898
diff changeset
   183
    "
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   184
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   185
    "Modified: / 21-11-2012 / 08:45:53 / cg"
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   186
!
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
    ^ RootHolder
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   191
!
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
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   194
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
   195
    RootHolder := aRoot
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   196
! !
c04d4781a37e next stage
penk
parents: 3949
diff changeset
   197
4915
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
   198
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'!
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   199
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   200
addBookmark:aDirectoryPath
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   201
    "add aDirectoryPath to the list of our known bookmarks.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   202
     Do not add duplicates."
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   203
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   204
    |bookmarks|
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   205
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   206
    bookmarks := self directoryBookmarks.
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   207
    (bookmarks includes:aDirectoryPath) ifFalse:[
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   208
        bookmarks add:aDirectoryPath asFilename.
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   209
    ].
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   210
!
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   211
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   212
bookmarksFrom:aFileNameOrString
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   213
    |bookmarks s fileName line|
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   214
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   215
    fileName := aFileNameOrString asFilename.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   216
    [
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   217
        s := fileName readStream.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   218
    ] on:OpenError do:[:ex|
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   219
        ^ nil.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   220
    ].
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   221
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   222
    bookmarks := OrderedCollection new.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   223
    [s atEnd] whileFalse:[
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   224
        line := s nextLine.
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   225
        (line startsWith:';') ifFalse:[
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   226
            bookmarks add:(Base64Coder decode:line) asString.
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   227
        ]
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   228
    ].
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   229
    s close.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   230
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   231
    ^ bookmarks
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   232
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   233
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   234
defaultBookMarksFileDirectory
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   235
    "the directory, where the default bookmarks are stored (as defaultBookMarksFilename)"
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   236
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
   237
    ^ Filename homeDirectory
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   238
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   239
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   240
defaultBookMarksFilename
12390
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   241
    "the filename, in which the default bookmarks are stored (in defaultBookMarksDirectory)"
70b71b28a20f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12102
diff changeset
   242
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   243
    ^ '.fileBrowserBookmarks'
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   244
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   245
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   246
directoryBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   247
    DirectoryBookmarks isNil ifTrue:[                     
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
   248
        self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename).
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   249
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   250
        DirectoryBookmarks isEmptyOrNil ifTrue:[
17979
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   251
            DirectoryBookmarks := 
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   252
                OrderedCollection 
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   253
                    with:(Filename homeDirectory asAbsoluteFilename)
0854fb9b7e58 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17946
diff changeset
   254
                    with:(Filename currentDirectory asAbsoluteFilename).
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   255
        ]
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
    ^ DirectoryBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   258
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   259
    "
5438
fa19d526d85d directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents: 5437
diff changeset
   260
     DirectoryBookmarks := nil.
fa19d526d85d directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents: 5437
diff changeset
   261
     self directoryBookmarks.
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   262
    "
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   263
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   264
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   265
directoryBookmarks: collectionOfFilenames
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   266
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   267
    DirectoryBookmarks := collectionOfFilenames.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   268
    self saveBookmarksInDefaultBookmarksFile.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   269
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   270
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   271
editBookmarksWithDefault: aFilenameOrNil
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   272
    | oldBookmarks newBookmarks |
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   273
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   274
    oldBookmarks := self directoryBookmarks copy.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   275
    newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   276
    newBookmarks isNil ifTrue:[^ self].
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   277
    self directoryBookmarks: newBookmarks.
9681
00195b8c6cf6 comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents: 9677
diff changeset
   278
00195b8c6cf6 comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents: 9677
diff changeset
   279
    "Modified: / 13-01-2011 / 12:52:28 / cg"
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   280
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   281
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   282
hasBookmarks
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
   283
    ^ self directoryBookmarks notEmptyOrNil
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   284
!
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   285
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   286
loadBookmarksFrom:aFileNameOrString
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   287
    |bookmarks|
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   288
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   289
    bookmarks := self bookmarksFrom: aFileNameOrString.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   290
    bookmarks isNil ifTrue:[^ self].
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   291
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   292
    DirectoryBookmarks := OrderedCollection new.
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   293
    bookmarks do:[:eachPath |
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   294
        self addBookmark:eachPath asFilename
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   295
    ].
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   296
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   297
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   298
removeBookmark:aDirectoryPath
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   299
    |bookmarks|
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   300
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   301
    bookmarks := self directoryBookmarks.
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   302
    bookmarks isEmptyOrNil ifTrue:[ ^ self].
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   303
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   304
    bookmarks remove:aDirectoryPath ifAbsent:[].
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   305
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   306
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   307
saveBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   308
    |fn|
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   309
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   310
    fn := Dialog 
18747
138797ada819 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18746
diff changeset
   311
            requestFileNameForSave:(self resources string:'Save Bookmarks')
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   312
            default:(self defaultBookMarksFilename)
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   313
            fromDirectory:(self defaultBookMarksFileDirectory).
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   314
    fn isEmptyOrNil ifTrue:[^ self].
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   315
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   316
    self saveBookmarksIn:fn
9607
63f0d2689895 changed: #saveBookmarks
Claus Gittinger <cg@exept.de>
parents: 9599
diff changeset
   317
63f0d2689895 changed: #saveBookmarks
Claus Gittinger <cg@exept.de>
parents: 9599
diff changeset
   318
    "Modified: / 27-10-2010 / 11:27:09 / cg"
18747
138797ada819 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18746
diff changeset
   319
    "Modified: / 01-05-2019 / 11:45:37 / Claus Gittinger"
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   320
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   321
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   322
saveBookmarks: bookmarks in:aFileNameOrString
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   323
    "save the bokmarks in aFileNameOrString.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   324
     Use Base64 coding"
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   325
13683
e31bd21c4760 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13677
diff changeset
   326
    |bookmarkStream fileName coder|
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   327
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   328
    fileName := aFileNameOrString asFilename.
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   329
    fileName exists ifTrue:[
13683
e31bd21c4760 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13677
diff changeset
   330
        fileName renameTo:(fileName addSuffix:'sav').
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   331
    ].
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   332
    bookmarkStream := fileName writeStream.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   333
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   334
    "save each bookmark in one line"
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   335
    coder := (Base64Coder on:bookmarkStream) lineLimit:nil.
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
   336
    bookmarks do:[:eachPath |
6114
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   337
        eachPath asFilename pathName acceptVisitor:coder.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   338
        coder flush.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   339
        bookmarkStream cr.
36fb19194510 Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents: 6113
diff changeset
   340
    ].
12391
87ca5c4d1270 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12390
diff changeset
   341
    bookmarkStream syncData; close.
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   342
!
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   343
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   344
saveBookmarksIn:aFileNameOrString
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   345
    "save the bokmarks in aFileNameOrString.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   346
     Use Base64 coding"
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   347
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   348
    | bookmarks |
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   349
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   350
    bookmarks := self directoryBookmarks.
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   351
    self saveBookmarks: bookmarks in:aFileNameOrString
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   352
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
   353
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   354
saveBookmarksInDefaultBookmarksFile
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
   355
    self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename)
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
4915
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
   358
!AbstractFileBrowser class methodsFor:'accessing-classes'!
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   359
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   360
directoryHistoryClass
12062
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   361
    ^ DirectoryHistory
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   362
0056d17cf012 conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents: 11996
diff changeset
   363
    "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
   364
! !
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
   365
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   366
!AbstractFileBrowser class methodsFor:'defaults'!
321c1729db5b initial checkin
penk
parents:
diff changeset
   367
321c1729db5b initial checkin
penk
parents:
diff changeset
   368
commandHistory
321c1729db5b initial checkin
penk
parents:
diff changeset
   369
321c1729db5b initial checkin
penk
parents:
diff changeset
   370
    CommandHistory isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   371
        CommandHistory := OrderedCollection new.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   372
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   373
    ^ CommandHistory
321c1729db5b initial checkin
penk
parents:
diff changeset
   374
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   375
321c1729db5b initial checkin
penk
parents:
diff changeset
   376
commandHistorySize
4190
4b0ea23f558e *** empty log message ***
penk
parents: 4189
diff changeset
   377
    "max no of entries in the HistoryList "
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
   378
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   379
    CommandHistorySize isNil ifTrue:[
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
   380
        CommandHistorySize := 150
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   381
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   382
    ^ CommandHistorySize
321c1729db5b initial checkin
penk
parents:
diff changeset
   383
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   384
321c1729db5b initial checkin
penk
parents:
diff changeset
   385
defaultFilterList
321c1729db5b initial checkin
penk
parents:
diff changeset
   386
321c1729db5b initial checkin
penk
parents:
diff changeset
   387
    DefaultFilters isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   388
        DefaultFilters := #(        '*'
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   389
                                    '*.st' 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   390
                                    '*.[h,c]*' 
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   391
                                    '*.txt; *.htm*' 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   392
                                    '*.gif; *.xpm; *.jpg; *.png' 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   393
                                    '~*o; ~*.obj; ~*.dll;' 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   394
                                )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   395
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   396
    ^ DefaultFilters.
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   397
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   398
    "
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   399
     DefaultFilters := nil
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
   400
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   401
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   402
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   403
initialCommandFor:fileName in:aDirectory intoBox:aBox
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   404
    "set a useful initial command in an execute box."
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   405
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   406
    |mime cmd select path suffix baseName pathName|
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   407
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   408
    path := aDirectory filenameFor:fileName.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   409
    baseName := path baseName.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   410
    suffix := path suffix.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   411
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   412
    cmd := UserPreferences current defaultFileOpenCommandFor:suffix.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   413
    cmd notNil ifTrue:[
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   414
        aBox initialText:(cmd bindWith:fileName pathName).
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   415
        ^ self
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   416
    ].
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
   417
    
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   418
    mime := MIMETypes mimeTypeForSuffix:suffix.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   419
"/    mime notNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   420
"/        cmd := self initialCommandForMIME:mime file:path
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   421
"/    ].
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
    "/ 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
   424
    "/ XXX or from resources.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   425
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   426
    (path type == #regular) ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   427
        path isExecutableProgram ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   428
            aBox initialText:(path pathName , ' <arguments>').
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   429
            ^ self
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
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   432
        select := true.
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
        "some heuristics - my personal preferences ...
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   435
         (actually this should come from a configfile)"
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   436
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   437
        (baseName endsWith:'akefile') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   438
            aBox initialText:'make target' selectFrom:6 to:11.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   439
            ^ self
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   440
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   441
18264
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   442
        cmd := MIMETypes defaultCommandTemplateToOpenMimeType:mime.
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   443
        cmd notNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   444
            select := false
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   445
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   446
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   447
        cmd isNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   448
            suffix := path suffix.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   449
            (suffix = 'C') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   450
                cmd := 'g++ -c %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   451
                select := 6.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   452
            ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   453
                suffix := suffix asLowercase.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   454
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   455
                (suffix = 'taz') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   456
                    aBox initialText:'zcat %1 | tar tvf -'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   457
                    select := false.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   458
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   459
                (suffix = 'tar') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   460
                    cmd := 'tar tvf %1'.
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   461
                    select := 'tar tvf' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   462
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   463
                (suffix = 'zoo') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   464
                    cmd := 'zoo -list %1'.
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   465
                    select := 'zoo -list' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   466
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   467
                (suffix = 'zip') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   468
                    cmd := 'unzip -l %1'.
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   469
                    select := 'unzip -l' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   470
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   471
                (suffix = 'jar') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   472
                    cmd := 'unzip -l %1'.
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   473
                    select := 'unzip -l' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   474
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   475
                (suffix = 'z') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   476
                    (baseName asLowercase endsWith:'tar.z') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   477
                        cmd := 'zcat %1 | tar tvf -'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   478
                        select := false.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   479
                    ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   480
                        cmd := 'uncompress %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   481
                    ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   482
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   483
                (suffix = 'gz') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   484
                    (baseName asLowercase endsWith:'tar.gz') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   485
                        cmd := ('gunzip < %1 | tar tvf -' ).
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   486
                        select := false.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   487
                    ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   488
                        cmd := 'gunzip %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   489
                    ].
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 = 'html') ifTrue:[
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   492
                    "/ cmd := 'netscape %1'
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   493
                    cmd := 'firefox %1'.
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   494
                    select := 'firefox' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   495
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   496
                (suffix = 'htm') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   497
                    cmd := 'netscape %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   498
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   499
                (suffix = 'uue') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   500
                    cmd := 'uudecode %1'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   501
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   502
                (suffix = 'c') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   503
                    cmd := 'cc -c %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   504
                    select := 5.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   505
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   506
                (suffix = 'cc') ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   507
                    cmd := 'g++ -c %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   508
                    select := 6.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   509
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   510
                (suffix = 'xbm') ifTrue:[
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   511
                    cmd := 'bitmap %1'.
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   512
                    select := 'bitmap' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   513
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   514
                (suffix = 'ps') ifTrue:[
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   515
                    cmd := 'ghostview %1'.
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   516
                    select := 'ghostview' size
4496
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
                ((suffix = '1') or:[suffix = 'man']) ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   519
                    cmd := 'nroff -man %1'.
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   520
                    select := 'nroff -man' size
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   521
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   522
            ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   523
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   524
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   525
        cmd isNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   526
            DefaultCommandPerSuffix isNil ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   527
                cmd := '<cmd>'
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   528
            ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   529
                cmd := DefaultCommandPerSuffix 
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   530
                        at:suffix
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   531
                        ifAbsent:'<cmd>'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   532
            ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   533
            cmd := cmd , ' %1'.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   534
        ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   535
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   536
        pathName := path pathName.
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   537
        OperatingSystem isUNIXlike ifTrue:[
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   538
            pathName includesSeparator ifTrue:[
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   539
                pathName := '"' , pathName , '"'
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   540
            ]
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   541
        ].
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   542
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
   543
        cmd := cmd bindWith:pathName.
4496
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   544
        select == false ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   545
            aBox initialText:cmd
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   546
        ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   547
            select class == Interval ifTrue:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   548
                aBox initialText:cmd selectFrom:select start to:select stop
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   549
            ] ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   550
                select isInteger ifFalse:[
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   551
                    select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1.
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   552
                ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   553
                aBox initialText:cmd selectFrom:1 to:select
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   554
            ].
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   555
        ]
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   556
    ]
513e99a8621b defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
   557
18264
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   558
    "Modified: / 24-09-1997 / 16:34:52 / stefan"
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   559
    "Modified: / 09-04-1998 / 17:15:57 / cg"
4bf515143c81 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18248
diff changeset
   560
    "Modified: / 09-07-2018 / 11:16:30 / Stefan Vogel"
18578
c707daaac50b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18525
diff changeset
   561
    "Modified: / 05-02-2019 / 10:23:20 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   562
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   563
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   564
listOfRuntimeValuesToRemember
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   565
    " 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
   566
    
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   567
    ^ #( 
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   568
"/        #filterModel
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   569
        #enableFileHistory
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   570
        #fileHistory
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   571
        #currentSortOrder
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   572
        #sortBlockProperty 
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   573
       )
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   574
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   575
321c1729db5b initial checkin
penk
parents:
diff changeset
   576
resetAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
   577
321c1729db5b initial checkin
penk
parents:
diff changeset
   578
    RuntimeAspects := nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
   579
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   580
    "
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   581
     self resetAspects
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
   582
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   583
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   584
321c1729db5b initial checkin
penk
parents:
diff changeset
   585
runtimeAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
   586
321c1729db5b initial checkin
penk
parents:
diff changeset
   587
    RuntimeAspects isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
   588
        RuntimeAspects := Dictionary new.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   589
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
   590
    ^ RuntimeAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
   591
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   592
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   593
userPreferencesAspectList
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   594
    " list of all aspects that will be saved with save settings
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   595
      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
   596
      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
   597
    "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   598
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   599
    ^ Dictionary 
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   600
        withKeysAndValues:#(
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   601
           viewDirsInContentsBrowser   true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   602
           showDirectoryTree           true
11501
7f8a01b9b166 class definition
Claus Gittinger <cg@exept.de>
parents: 11494
diff changeset
   603
           showHiddenFiles             true
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   604
           viewDescription             false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   605
           viewDetails                 true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   606
           viewDirectoryDescription    false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   607
           viewFilesInDirectoryTree    false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   608
           viewGroup                   false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   609
           viewOwner                   false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   610
           viewPermissions             false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   611
           viewPreview                 false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   612
           viewSize                    true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   613
           viewSizeInKiloBytes         false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   614
           viewSizeInBytes             false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   615
           viewTime                    true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   616
           viewType                    false
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   617
           openMultipleApplicationsForType false
7788
c391cddbd84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7763
diff changeset
   618
           filenameEntryFieldVisibleHolder   true
c391cddbd84a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7763
diff changeset
   619
           toolBarVisibleHolder        true
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   620
           sortDirectoriesBeforeFiles  true
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   621
           openAlwaysInTextEditor      false
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
   622
           alwaysUseSmalltalkTools     true
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   623
           sortCaseless                false
13011
fe61ebc8f857 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13000
diff changeset
   624
           "/ 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
   625
           showDirectoriesOnTop        false 
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
   626
      )
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   627
11501
7f8a01b9b166 class definition
Claus Gittinger <cg@exept.de>
parents: 11494
diff changeset
   628
    "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
   629
    "Modified: / 12-08-2014 / 13:13:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   630
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
   631
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   632
!AbstractFileBrowser class methodsFor:'drag & drop'!
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   633
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   634
doStartDrag:aDropSource in:aView
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   635
    "set the cursors before starting the drag & drop operation"
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|
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
    hdl := DragAndDropManager new.
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
    hdl disabledCursor:self disabledCursorIcon.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   642
    hdl enabledCursor:self enabledCursorIcon.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   643
    hdl alienCursor:nil.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   644
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   645
    hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft.
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   646
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   647
    "Modified: / 23-07-2007 / 23:00:38 / cg"
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   648
! !
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   649
5398
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   650
!AbstractFileBrowser class methodsFor:'help specs'!
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   651
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   652
basicHelpSpec
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   653
    <resource: #help>
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   654
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   655
    ^ super helpSpec addPairsFrom:#(
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   656
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   657
#lockFileEncoding
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   658
'Do not guess the encoding from the file''s contents.'
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   659
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6099
diff changeset
   660
#closeTabButton
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   661
'Close this tab'
6100
cfed9da80b68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6099
diff changeset
   662
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   663
#addTerminal
17182
5f178bffa275 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17119
diff changeset
   664
'Add a shell terminal page'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   665
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   666
#make
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   667
'Call the make command'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   668
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   669
#searchFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   670
'Search a file'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   671
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   672
#directoryUp
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   673
'Directory up'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   674
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   675
#directoryBack
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   676
'Directory back'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   677
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   678
#directoryForward
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   679
'Directory forward'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   680
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   681
#directoryHistory
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   682
'Directory'
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   683
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   684
#copyFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   685
'Copy the selected file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   686
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   687
#cutFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   688
'Cut the selected file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   689
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   690
#editFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   691
'Edit the selected file'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   692
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   693
#fileHome
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   694
'Goto home directory'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   695
8093
426a17ddceb6 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 8091
diff changeset
   696
#fileDesktop
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   697
'Goto desktop directory'
8093
426a17ddceb6 doGotoDesktopDirectory
Claus Gittinger <cg@exept.de>
parents: 8091
diff changeset
   698
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   699
#fileGotoDefault
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   700
'Goto default directory (ST/X start directory)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   701
6454
649bdd4e5639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6434
diff changeset
   702
#fileGotoSmalltalkDirectory
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   703
'Goto Smalltalk directory (ST/X application)'
6454
649bdd4e5639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6434
diff changeset
   704
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
   705
#fileGotoDefaultDirectory
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   706
'Goto current directory'
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
   707
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   708
#pasteFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   709
'Paste file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   710
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   711
#deleteFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   712
'Delete the selected file(s)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   713
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   714
#fileIn
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   715
'File in'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   716
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   717
#fileHistory
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   718
'File history'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   719
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   720
#fileGotoBookmark
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   721
'Goto bookmarked directory'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   722
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   723
#hideToolBar
13910
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   724
'Hide the toolbar (show again via "View"-menu)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   725
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   726
#hideFilenameEntryField
13910
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   727
'Hide filename & filter fields (show again via "View"-menu)'
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   728
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   729
#hideBookmarks
d32792f13ebf class: SimpleView
Claus Gittinger <cg@exept.de>
parents: 13856
diff changeset
   730
'Hide the bookmarks (show again via "View"-menu)'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   731
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   732
#openChangeBrowser
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   733
'Open a Changebrowser on file'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   734
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   735
#showFileDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   736
'Show file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   737
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   738
#hideFileDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   739
'Hide file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   740
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   741
#toggleDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   742
'Show/hide file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   743
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   744
#viewDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   745
'Show/hide file details'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   746
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   747
#selectDetails
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   748
'Select file details to be shown'
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   749
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   750
#showDifferences
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   751
'Show differences between file and editor versions'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   752
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   753
#toggleHexDisplay
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   754
'Toggle between hexadecimal and textual representation'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   755
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   756
#findInBrowser
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   757
'Navigate the browser''s file list to the edited file'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   758
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   759
#saveFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   760
'Save the editor''s contents into the file'
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   761
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   762
#saveFileAs
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   763
'Save the editor''s contents into another file'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   764
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   765
#reloadFile
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   766
'Reload from the file'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   767
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   768
#print
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   769
'Send to the printer'
8088
a43361dddfc9 menu & flyByHelp
Claus Gittinger <cg@exept.de>
parents: 8082
diff changeset
   770
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   771
).
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   772
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   773
    "
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   774
     self helpSpec
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   775
    "
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   776
10775
d5be49adfc5e changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10762
diff changeset
   777
    "Modified: / 06-10-2011 / 14:55:27 / cg"
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
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   780
helpSpec
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   781
    <resource: #programHelp>
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   782
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   783
    |spec hist resources|
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   784
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   785
    spec := self basicHelpSpec.
8261
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   786
caa4bb627c03 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8256
diff changeset
   787
    "/ add help items for the history
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   788
    hist := self directoryHistory.
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   789
    hist notNil ifTrue:[
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   790
        resources := self classResources.
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   791
        hist canForward ifTrue:[
7879
9c64dea1b14a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 7869
diff changeset
   792
            spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ].
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   793
        ].
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   794
        hist canBackward ifTrue:[
7879
9c64dea1b14a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 7869
diff changeset
   795
            spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ].
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   796
        ].
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   797
    ].
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   798
    ^ spec.
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   799
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   800
    "
17889
b27bc6aaaab9 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17871
diff changeset
   801
     self helpSpec
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   802
    "
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
   803
7879
9c64dea1b14a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 7869
diff changeset
   804
    "Modified: / 03-11-2007 / 12:05:01 / cg"
5398
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   805
! !
61e42b6e1b84 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5383
diff changeset
   806
8994
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   807
!AbstractFileBrowser class methodsFor:'image specs'!
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
clearHistoryIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   810
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   811
17413
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   812
    ^ ToolbarIconLibrary deleteIcon
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   813
    "/ ^ Icon deleteIcon
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   814
7cc4bf5ee256 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17288
diff changeset
   815
    "Modified: / 15-02-2017 / 19:45:24 / cg"
8994
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   816
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   817
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   818
copyIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   819
    <resource: #programImage>
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
    ^ ToolbarIconLibrary copyIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   822
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   823
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   824
cutIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   825
    <resource: #programImage>
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
    ^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon"
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   828
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   829
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   830
deleteIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   831
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   832
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   833
    ^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   834
!
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   835
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   836
directoryUpIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   837
    <resource: #programImage>
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   838
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   839
    ^ ToolbarIconLibrary directoryUpIcon
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
   840
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   841
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   842
disabledCursorIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   843
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   844
     by the ImageEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   847
     the ImageEditor may not be able to read the specification."
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
    "
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   850
     self disabledCursorIcon inspect
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   851
     ImageEditor openOnClass:self andSelector:#disabledCursorIcon
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   852
     Icon flushCachedIcons
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   853
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   854
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   855
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   856
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   857
    ^Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   858
        constantNamed:#'AbstractFileBrowser class disabledCursorIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   859
        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
   860
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@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
   861
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
   862
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@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
   863
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   864
!
6337
76a3f145aaad code cleanup
Claus Gittinger <cg@exept.de>
parents: 6335
diff changeset
   865
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   866
enabledCursorIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   867
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   868
     by the ImageEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   871
     the ImageEditor may not be able to read the specification."
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
    "
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   874
     self enabledCursorIcon inspect
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
   875
     ImageEditor openOnClass:self andSelector:#enabledCursorIcon
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   876
     Icon flushCachedIcons
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   877
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   878
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   879
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   880
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   881
    ^Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   882
        constantNamed:#'AbstractFileBrowser class enabledCursorIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   883
        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
   884
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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
   885
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
   886
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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
   887
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   888
!
6337
76a3f145aaad code cleanup
Claus Gittinger <cg@exept.de>
parents: 6335
diff changeset
   889
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   890
fileInIcon
321c1729db5b initial checkin
penk
parents:
diff changeset
   891
    <resource: #programImage>
321c1729db5b initial checkin
penk
parents:
diff changeset
   892
6116
acc7f6b44b4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6114
diff changeset
   893
    ^ ToolbarIconLibrary fileInIcon
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   894
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   895
6079
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   896
historyBackIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   897
    <resource: #programImage>
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
    ^ ToolbarIconLibrary historyBackIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   900
!
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   901
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   902
historyForwardIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   903
    <resource: #programImage>
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   904
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   905
    ^ ToolbarIconLibrary historyForwardIcon
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   906
!
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   907
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   908
homeIcon
321c1729db5b initial checkin
penk
parents:
diff changeset
   909
    <resource: #programImage>
321c1729db5b initial checkin
penk
parents:
diff changeset
   910
6079
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   911
    ^ ToolbarIconLibrary homeIcon
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
   912
!
321c1729db5b initial checkin
penk
parents:
diff changeset
   913
6074
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   914
homeIcon2
6079
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   915
    <resource: #programImage>
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   916
ab46672791d1 iconLibrary cleanup
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   917
    ^ ToolbarIconLibrary homeIcon2
6074
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   918
!
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   919
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   920
htmlReloadIcon
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   921
    <resource: #programImage>
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   922
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   923
    ^ ToolbarIconLibrary reload22x22Icon
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   924
!
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
   925
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   926
leftDownIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   927
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   928
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   929
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   930
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   931
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   932
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   933
     self leftDownIcon inspect
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   934
     ImageEditor openOnClass:self andSelector:#leftDownIcon"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   935
    
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   936
    ^ Icon constantNamed:#'AbstractFileBrowser class leftDownIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   937
        ifAbsentPut:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   938
            (Depth2Image new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   939
                width:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   940
                height:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   941
                photometric:(#palette);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   942
                bitsPerSample:(#( 2 ));
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   943
                samplesPerPixel:(1);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   944
                bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   945
                            fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   946
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
   947
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
   948
UUUU@@@@@@@AUUUUUUUUUP@a');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   949
                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
   950
                mask:((ImageMask new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   951
                            width:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   952
                            height:28;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   953
                            bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   954
                                        fromPackedString:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   955
@@@@@@@@@@@@ @@@@\@@@@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
   956
?>@C??? @???8@O??>@@@@@@@@@@@@@a');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   957
                            yourself);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   958
                yourself
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   959
        ]
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   962
menuHistoryList9x20Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   963
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   964
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   965
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   966
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   967
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   968
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   969
     self menuHistoryList9x20Icon inspect
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   970
     ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   971
     Icon flushCachedIcons"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   972
    
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   973
    ^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   974
        ifAbsentPut:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   975
            (Depth1Image new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   976
                width:9;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   977
                height:20;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   978
                photometric:(#palette);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   979
                bitsPerSample:(#( 1 ));
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   980
                samplesPerPixel:(1);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   981
                bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   982
                            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
   983
                colorMapFromArray:#[ 255 255 255 0 0 0 ];
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   984
                mask:((ImageMask new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   985
                            width:9;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   986
                            height:20;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   987
                            bits:(ByteArray 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   988
                                        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
   989
                            yourself);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   990
                yourself
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   991
        ]
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   994
menuHistoryListIcon
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   995
    <resource: #image>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   996
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   997
     by the ImageEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   998
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
   999
     the ImageEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1000
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1001
     self menuHistoryListIcon inspect
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1002
     ImageEditor openOnClass:self andSelector:#menuHistoryListIcon"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1003
    
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1004
    ^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryListIcon'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1005
        ifAbsentPut:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1006
            (Depth1Image 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
                photometric:(#palette);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1010
                bitsPerSample:(#( 1 ));
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1011
                samplesPerPixel:(1);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1012
                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
  1013
                colorMapFromArray:#[ 255 255 255 0 0 0 ];
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1014
                mask:((ImageMask new)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1015
                            width:12;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1016
                            height:12;
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1017
                            bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@');
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1018
                            yourself);
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1019
                yourself
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1020
        ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1021
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1022
6087
344513ffd6a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6083
diff changeset
  1023
newDirectoryIcon
6074
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
  1024
    <resource: #programImage>
511fe499929b icons moved
Claus Gittinger <cg@exept.de>
parents: 6034
diff changeset
  1025
6087
344513ffd6a1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6083
diff changeset
  1026
    ^ ToolbarIconLibrary newDirectoryIcon
3923
2988fc3c88ab next stage
penk
parents: 3922
diff changeset
  1027
!
2988fc3c88ab next stage
penk
parents: 3922
diff changeset
  1028
6091
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1029
removeTabIcon
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1030
    <resource: #programImage>
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1031
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1032
    ^ ToolbarIconLibrary removeTabIcon
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1033
!
f908a6db19ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6087
diff changeset
  1034
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1035
vt100Terminal
321c1729db5b initial checkin
penk
parents:
diff changeset
  1036
    <resource: #programImage>
321c1729db5b initial checkin
penk
parents:
diff changeset
  1037
321c1729db5b initial checkin
penk
parents:
diff changeset
  1038
    ^ ToolbarIconLibrary shell20x20Icon
321c1729db5b initial checkin
penk
parents:
diff changeset
  1039
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  1040
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  1041
!AbstractFileBrowser class methodsFor:'interface specs'!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  1042
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1043
encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1044
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1045
     by the UIPainter of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1048
     the UIPainter may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1051
     UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1052
     AbstractFileBrowser new openInterface:#encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1053
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1054
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1055
    <resource: #canvas>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1056
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1057
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1058
    #(FullSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1059
       name: encodingDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1060
       window: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1061
      (WindowSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1062
         label: 'File Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1063
         name: 'File Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1064
         min: (Point 10 10)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1065
         bounds: (Rectangle 0 0 379 590)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1066
       )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1067
       component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1068
      (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1069
         collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1070
          (LabelSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1071
             label: 'Select the External (File-) Encoding:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1072
             name: 'Label1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1073
             layout: (LayoutFrame 0 0 0 0 0 1 30 0)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1074
             translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1075
             adjust: left
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1076
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1077
          (DataSetSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1078
             name: 'Table1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1079
             layout: (LayoutFrame 0 0 30 0 0 1 -60 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1080
             model: selectedEncoding
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1081
             hasHorizontalScrollBar: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1082
             hasVerticalScrollBar: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1083
             dataList: encodingList
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1084
             has3Dseparators: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1085
             columns: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1086
            (Array
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1087
               
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1088
              (DataSetColumnSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1089
                 label: 'Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1090
                 labelButtonType: Button
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1091
                 height: heightOfFirstRow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1092
                 model: at:
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1093
                 canSelect: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1094
                 isResizeable: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1095
                 showRowSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1096
                 showColSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1097
               ) 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1098
              (DataSetColumnSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1099
                 label: 'Description'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1100
                 labelButtonType: Button
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1101
                 height: heightOfFirstRow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1102
                 model: at:
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1103
                 canSelect: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1104
                 isResizeable: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1105
                 showRowSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1106
                 showColSeparator: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1107
               )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1108
             )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1109
             doubleClickChannel: accept
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
          (CheckBoxSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1112
             label: 'Lock Encoding'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1113
             name: 'LockEncodingCheckBox'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1114
             layout: (LayoutFrame 3 0 -60 1 217 0 -30 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1115
             activeHelpKey: lockFileEncoding
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1116
             model: lockFileEncoding
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1117
             translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1118
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1119
          (HorizontalPanelViewSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1120
             name: 'ButtonPanel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1121
             layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1122
             horizontalLayout: fitSpace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1123
             verticalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1124
             horizontalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1125
             verticalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1126
             reverseOrderIfOKAtLeft: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1127
             component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1128
            (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1129
               collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1130
                (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1131
                   label: 'Cancel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1132
                   name: 'Button2'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1133
                   translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1134
                   model: cancel
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1135
                   extent: (Point 183 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
                (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1138
                   label: 'OK'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1139
                   name: 'Button1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1140
                   translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1141
                   model: accept
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1142
                   isDefault: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1143
                   extent: (Point 184 22)
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
             )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1148
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1149
          )
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
       )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1152
     )
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
lineEndConventionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1156
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1157
     by the UIPainter of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1160
     the UIPainter may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1161
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1162
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1163
     UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1164
     AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1165
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1166
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1167
    <resource: #canvas>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1168
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1169
    ^ 
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1170
    #(FullSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1171
       name: lineEndConventionDialogSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1172
       window: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1173
      (WindowSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1174
         label: 'Line-End Convention'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1175
         name: 'Line-End Convention'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1176
         min: (Point 10 10)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1177
         bounds: (Rectangle 0 0 379 239)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1178
       )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1179
       component: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1180
      (SpecCollection
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1181
         collection: (
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1182
          (LabelSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1183
             label: 'Select the Line-End Convention (used when saving files):'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1184
             name: 'Label1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1185
             layout: (LayoutFrame 0 0 0 0 0 1 30 0)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1186
             translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1187
             adjust: left
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1188
           )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1189
          (VerticalPanelViewSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1190
             name: 'VerticalPanel1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1191
             layout: (LayoutFrame 20 0 40 0 0 1 -30 1)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1192
             horizontalLayout: fit
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1193
             verticalLayout: topSpace
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1194
             horizontalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1195
             verticalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1196
             component: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1197
            (SpecCollection
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1198
               collection: (
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1199
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1200
                   label: 'NL (Unix)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1201
                   name: 'RadioButton1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1202
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1203
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1204
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1205
                   select: nl
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1206
                   extent: (Point 359 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1207
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1208
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1209
                   label: 'CR-NL (MSDOS)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1210
                   name: 'RadioButton4'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1211
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1212
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1213
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1214
                   select: crlf
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1215
                   extent: (Point 359 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1216
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1217
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1218
                   label: 'CR (VMS and pre OSX mac)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1219
                   name: 'RadioButton5'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1220
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1221
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1222
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1223
                   select: cr
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1224
                   extent: (Point 359 22)
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1225
                 )
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1226
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1227
                   label: 'ETX (some modem protocols and mainframe files)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1228
                   name: 'RadioButton6'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1229
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1230
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1231
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1232
                   select: etx
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1233
                   extent: (Point 359 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1234
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1235
                (RadioButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1236
                   label: 'EOT (some modem protocols and mainframe files)'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1237
                   name: 'RadioButton7'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1238
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1239
                   model: lineEndConvention
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1240
                   isTriggerOnDown: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1241
                   select: eot
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1242
                   extent: (Point 359 22)
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1243
                 )
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1244
                )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1245
              
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1246
             )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1247
           )
15212
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1248
          (HorizontalPanelViewSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1249
             name: 'ButtonPanel'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1250
             layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1251
             horizontalLayout: fitSpace
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1252
             verticalLayout: center
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1253
             horizontalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1254
             verticalSpace: 3
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1255
             reverseOrderIfOKAtLeft: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1256
             component: 
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1257
            (SpecCollection
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1258
               collection: (
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1259
                (ActionButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1260
                   label: 'Cancel'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1261
                   name: 'Button2'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1262
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1263
                   model: cancel
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
                (ActionButtonSpec
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1267
                   label: 'OK'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1268
                   name: 'Button1'
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1269
                   translateLabel: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1270
                   model: accept
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1271
                   isDefault: true
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1272
                   extent: (Point 185 22)
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1273
                 )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1274
                )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1275
              
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1276
             )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1277
           )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1278
          )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1279
        
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1280
       )
0cb84cd9a32f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15211
diff changeset
  1281
     )
15211
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
tabStopConversionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1285
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1286
     by the UIPainter of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1289
     the UIPainter may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1292
     UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1293
     AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1294
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1295
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1296
    <resource: #canvas>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1297
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1298
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1299
     #(FullSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1300
        name: 'tabStopConversionDialogSpec'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1301
        window: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1302
       (WindowSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1303
          label: 'Tab-Stop Conversion'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1304
          name: 'Tab-Stop Conversion'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1305
          min: (Point 10 10)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1306
          bounds: (Rectangle 0 0 379 239)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1307
        )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1308
        component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1309
       (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1310
          collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1311
           (LabelSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1312
              label: 'Select the Tab-Stop Conversion (used when saving files):'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1313
              name: 'Label1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1314
              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1315
              translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1316
              adjust: left
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1317
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1318
           (VerticalPanelViewSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1319
              name: 'VerticalPanel1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1320
              layout: (LayoutFrame 0 0 30 0 0 1 -30 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1321
              horizontalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1322
              verticalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1323
              horizontalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1324
              verticalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1325
              component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1326
             (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1327
                collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1328
                 (RadioButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1329
                    label: '4'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1330
                    name: 'RadioButton1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1331
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1332
                    model: tabStops
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1333
                    isTriggerOnDown: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1334
                    select: 4
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1335
                    extent: (Point 136 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1336
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1337
                 (RadioButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1338
                    label: '8'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1339
                    name: 'RadioButton4'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1340
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1341
                    model: tabStops
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1342
                    isTriggerOnDown: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1343
                    select: 8
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1344
                    extent: (Point 136 22)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1345
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1346
                 )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1347
               
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1348
              )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1349
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1350
           (HorizontalPanelViewSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1351
              name: 'ButtonPanel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1352
              layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1353
              horizontalLayout: fitSpace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1354
              verticalLayout: center
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1355
              horizontalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1356
              verticalSpace: 3
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1357
              reverseOrderIfOKAtLeft: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1358
              component: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1359
             (SpecCollection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1360
                collection: (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1361
                 (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1362
                    label: 'Cancel'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1363
                    name: 'Button2'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1364
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1365
                    model: cancel
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
                 (ActionButtonSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1369
                    label: 'OK'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1370
                    name: 'Button1'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1371
                    translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1372
                    model: accept
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1373
                    isDefault: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1374
                    extent: (Point 185 22)
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
               
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1378
              )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1379
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1380
           )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1381
         
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1382
        )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1383
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1384
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1385
    "Modified: / 28-02-2012 / 11:12:38 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1386
! !
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  1387
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  1388
!AbstractFileBrowser class methodsFor:'menu specs'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  1389
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1390
baseBookmarksMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1391
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1392
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1395
     the MenuEditor may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1398
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1399
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1400
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1401
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1402
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1403
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
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1406
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1407
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1408
            enabled: currentFilesHasDirectories
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1409
            label: 'Add Bookmark'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1410
            itemValue: addBookmark
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1411
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1412
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1413
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1414
            enabled: hasBookmarksToRemove
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1415
            label: 'Remove Bookmark'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1416
            itemValue: removeBookmark
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1417
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1418
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1419
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1420
            label: 'Save Bookmarks In...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1421
            itemValue: saveBookmarks
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1422
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1423
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1424
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1425
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1426
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1427
      )
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
baseBookmarksMenuSpec2
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1431
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1432
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1435
     the MenuEditor may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1438
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1439
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1440
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1441
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1442
    <resource: #menu>
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
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1445
     #(Menu
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
            label: 'Edit Bookmarks'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1449
            itemValue: editBookmarks
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1450
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1451
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1452
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1453
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1454
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1455
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1456
            enabled: currentFilesHasDirectories
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1457
            label: 'Add Bookmark'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1458
            itemValue: addBookmark
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1459
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1460
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1461
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1462
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1463
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1464
      )
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
browserMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1468
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1469
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1472
     the MenuEditor may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1476
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1477
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1478
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1479
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1480
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1481
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
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1484
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1485
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1486
            label: 'Spawn Filebrowser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1487
            itemValue: doSpawn
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1488
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1489
            shortcutKey: Ctrln
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1490
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1491
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1492
            label: 'Windows Explorer'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1493
            itemValue: doOpenExplorer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1494
            translateLabel: true
17946
8ecca5e905bd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17923
diff changeset
  1495
            isVisible: systemIsDOS
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1496
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1497
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1498
            label: 'Open Finder'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1499
            itemValue: doOpenFinder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1500
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1501
            isVisible: systemIsOSX
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1502
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1503
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1504
            label: 'C Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1505
            itemValue: doOpenCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1506
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1507
            isVisible: cBrowserMenuItemVisible
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1508
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1509
         (MenuItem
18432
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1510
            label: 'STXGDB Debugger'
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1511
            itemValue: doOpenGDBApplication
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1512
            translateLabel: true
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1513
            isVisible: stxgdbMenuItemVisible
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1514
          )
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1515
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1516
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1517
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1518
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1519
            label: 'Add Text Editor Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1520
            itemValue: newTextEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1521
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1522
            shortcutKey: Ctrlt
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1523
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1524
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1525
            label: 'Add Shell Terminal Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1526
            itemValue: doAddTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1527
            translateLabel: true
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: 'Add Archiver Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1531
            itemValue: doAddArchiver
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
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1534
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1535
            label: 'Add Search Page'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1536
            itemValue: doOpenSearchFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1537
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1538
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1539
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1540
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1541
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1542
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1543
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1544
            label: 'Settings...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1545
            itemValue: doOpenSettings
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1546
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1547
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1548
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1549
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1550
            label: 'Encoding...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1551
            itemValue: fileEncodingDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1552
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1553
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1554
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1555
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1556
            label: 'Line End Convention...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1557
            itemValue: lineEndConventionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1558
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1559
            isVisible: false
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1562
            label: 'Tab Stop Conversion...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1563
            itemValue: tabStopConversionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1564
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1565
            isVisible: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1566
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1567
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1568
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1569
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1570
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1571
            label: 'Exit'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1572
            itemValue: closeRequest
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1573
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1574
          )
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
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1577
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1578
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1579
17724
87f3d255c4e7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17715
diff changeset
  1580
    "Modified: / 29-10-2017 / 11:13:49 / cg"
18432
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  1581
    "Modified: / 26-09-2018 / 12:07:26 / Claus Gittinger"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1582
!
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
directoryMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1585
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1586
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1587
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1588
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1589
     the MenuEditor may not be able to read the specification."
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1592
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1593
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1594
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1595
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1596
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1597
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1598
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1599
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1600
     #(Menu
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
            label: 'Bookmarks'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1604
            submenuChannel: bookmarksMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1605
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1606
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1607
            label: 'Visited Directories'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1608
            submenuChannel: visitedDirectoriesMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1609
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1610
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1611
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1612
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1613
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1614
            label: 'Up'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1615
            itemValue: doGoDirectoryUp
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
            activeHelpKey: directoryBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1619
            enabled: enableBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1620
            label: 'Back'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1621
            itemValue: doBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1622
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1623
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1624
            activeHelpKey: directoryBack
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1625
            enabled: enableForward
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1626
            label: 'Forward'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1627
            itemValue: doForward
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1628
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1629
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1630
            label: '-'
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: enableHome
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1634
            label: 'Home Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1635
            itemValue: doGotoHomeDirectory
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1638
            enabled: enableGotoDesktopDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1639
            label: 'Desktop'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1640
            itemValue: doGotoDesktopDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1641
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1642
         (MenuItem
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  1643
            enabled: enableGotoDocumentsDirectory
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  1644
            label: 'Documents'
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  1645
            itemValue: doGotoDocumentsDirectory
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  1646
          )
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  1647
         (MenuItem
18352
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  1648
            enabled: enableGotoDownloadsDirectory
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  1649
            label: 'Downloads'
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  1650
            itemValue: doGotoDownloadsDirectory
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  1651
          )
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  1652
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1653
            enabled: enableGotoDefaultDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1654
            label: 'Default (Current) Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1655
            itemValue: doGotoDefaultDirectory
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1658
            enabled: enableGotoSmalltalkDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1659
            label: 'Smalltalk (Application) Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1660
            itemValue: doGotoSmalltalkDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1661
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1662
         (MenuItem
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1663
            enabled: enableGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1664
            label: 'Smalltalk Workspace Directory'
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1665
            itemValue: doGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1666
          )
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  1667
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1668
            enabled: enableGotoTempDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1669
            label: 'Smalltalk Temp Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1670
            itemValue: doGotoTempDirectory
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1673
            label: '-'
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1674
            isVisible: false
15211
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1677
            enabled: enableMakeCurrentDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1678
            label: 'Make this the Default (Current) Directory'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1679
            itemValue: doMakeCurrentDirectory
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1680
            isVisible: false
15211
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
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1683
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1684
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1685
      )
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1686
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  1687
    "Modified: / 17-07-2017 / 10:08:31 / cg"
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1688
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1689
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1690
editMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1691
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1692
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1695
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1696
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
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1699
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1700
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1701
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1702
    <resource: #menu>
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
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1705
     #(Menu
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1708
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1709
            label: 'Copy Selected Filenames to Clipboard'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1710
            itemValue: copySelectedFilenames
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1711
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1712
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1713
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1714
            enabled: fileListIsNotEmpty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1715
            label: 'Copy all Filenames to Clipboard'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1716
            itemValue: copyFileList
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1717
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1718
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1719
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1720
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1721
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1724
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1725
emptyMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1726
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1727
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1728
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1729
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1730
     the MenuEditor may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1733
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1734
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1737
    <resource: #menu>
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
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1740
     #(#Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1741
        #(
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1742
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1743
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1744
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1747
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1748
extraMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1749
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1750
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1751
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1752
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1753
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1754
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1757
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1758
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1759
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1760
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1761
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1762
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1763
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1764
     #(Menu
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1767
            label: 'Encoding...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1768
            itemValue: fileEncodingDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1769
            translateLabel: true
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1772
            label: 'Line End Convention...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1773
            itemValue: lineEndConventionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1774
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1775
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1776
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1777
            label: 'Tab Stop Conversion...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1778
            itemValue: tabStopConversionDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1779
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1780
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1781
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1782
            label: '-'
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1785
            label: 'Settings...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1786
            itemValue: doOpenSettings
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1787
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1788
            labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...')
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1789
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1790
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1791
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1792
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1795
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1796
fileMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1797
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1798
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1799
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1800
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1801
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1802
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1805
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1806
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1807
    "
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
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1810
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1811
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1812
     #(Menu
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: enableFileHistory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1816
            label: 'File History'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1817
            submenuChannel: menuFileHistory
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: 'Open'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1824
            itemValue: doShowFileContents
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1825
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1826
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1827
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1828
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1829
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1830
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1831
            label: 'FileIn'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1832
            itemValue: fileFileIn
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1833
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1834
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1835
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1836
            label: 'FileIn to Namespace...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1837
            itemValue: fileFileInToNameSpace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1838
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1839
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1840
            enabled: hasPackageDirectorySelected
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1841
            label: 'Load Package from Here'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1842
            itemValue: fileFileInPackage
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1843
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1844
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1845
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1846
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1847
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1848
            label: 'New'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1849
            submenuChannel: newMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1850
            keepLinkedMenu: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1851
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1852
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1853
            label: '-'
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
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1857
            label: 'Cut'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1858
            itemValue: cutFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1859
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1860
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1861
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1862
            label: 'Copy'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1863
            itemValue: copyFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1864
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1865
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1866
            enabled: canPaste
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1867
            label: 'Paste'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1868
            itemValue: pasteFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1869
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1870
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1871
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1872
            label: 'Delete'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1873
            itemValue: deleteFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1874
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1875
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1876
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1877
            label: 'Erase'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1878
            itemValue: eraseFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1879
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1880
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1881
            label: '-'
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: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1885
            label: 'Rename...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1886
            itemValue: renameSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1887
            shortcutKey: Rename
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1888
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1889
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1890
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1891
            label: 'Move To...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1892
            itemValue: moveSelectionTo
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1893
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1894
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1895
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1896
            label: 'Copy To...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1897
            itemValue: copySelectionTo
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1898
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1899
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1900
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1901
            label: 'Properties...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1902
            itemValue: doShowProperties
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1905
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1906
            isVisible: javaSupportLoaded
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1909
            enabled: canAddToClassPath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1910
            label: 'Add to Java Class Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1911
            isVisible: javaSupportLoaded
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1914
            enabled: canRemoveFromClassPath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1915
            label: 'Remove from Java Class Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1916
            isVisible: javaSupportLoaded
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1919
            enabled: canAddToSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1920
            label: 'Add to Java Source Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1921
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1922
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1923
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1924
            enabled: canRemoveFromSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1925
            label: 'Remove from Java Source Path'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1926
            isVisible: javaSupportLoaded
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1927
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1928
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1929
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1930
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1933
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1934
fileOpMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1935
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1936
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1937
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1938
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1939
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1940
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1943
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1944
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1945
    "
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
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1948
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1949
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1950
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1951
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1952
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1953
            enabled: hasFileSelection
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1954
            label: 'Split (by size)...'
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1955
            itemValue: splitSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1956
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1957
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1958
            enabled: hasFileSelection
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1959
            label: 'Split (by #lines)...'
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1960
            itemValue: splitSelectedFilesByLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1961
          )
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1962
         (MenuItem
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  1963
            enabled: hasFileSelection
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1964
            label: 'Join...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1965
            itemValue: joinSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1966
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1967
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1968
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1969
            label: 'Copy Corrupted File To...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1970
            itemValue: copySelectionToRepairingCorruptedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1971
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1972
         (MenuItem
15569
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1973
            label: 'Copy Corrupted File From -> To...'
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1974
            itemValue: copyFromToRepairingCorruptedFiles
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1975
          )
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  1976
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1977
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1978
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1979
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1980
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1981
            label: 'Rot13...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1982
            itemValue: filterSelectedFiles:
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1983
            argument: rot13
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1984
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1985
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1986
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1987
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1988
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1989
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1990
            label: 'Truncate...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1991
            itemValue: truncateSelectedFilesToZeroSize
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1992
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1993
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1994
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1995
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1996
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1997
            label: 'Load Signature Support Package'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1998
            itemValue: loadSignatureSupport
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  1999
            isVisible: cannotGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2000
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2001
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2002
            enabled: canGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2003
            label: 'Generate Signed Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2004
            itemValue: generateSignaturesForSelectedFiles
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: canGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2008
            label: 'Generate Detached Signature Files (use for dll)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2009
            itemValue: generateDetachedSignaturesForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2010
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2011
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2012
            enabled: canGenerateSignatureFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2013
            label: 'Generate Patch Installer for File(s)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2014
            itemValue: generatePatchInstallerForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2015
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2016
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2017
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2018
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2019
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2020
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2021
            label: 'File Differences'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2022
            itemValue: openDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2023
            isVisible: hasTwoFilesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2024
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2025
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2026
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2027
            label: 'File Differences...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2028
            itemValue: openDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2029
            isVisible: hasNotTwoFilesSelectedHolder
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2032
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2033
            label: 'Directory Differences'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2034
            itemValue: openDirectoryDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2035
            isVisible: hasTwoDirectoriesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2036
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2037
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2038
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2039
            label: 'Directory Differences...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2040
            itemValue: openDirectoryDiffView
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2041
            isVisible: hasNotTwoDirectoriesSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2042
          )
17831
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2043
         (MenuItem
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2044
            label: '-'
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2045
          )
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2046
         (MenuItem
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2047
            label: 'Remove .bak and .sav Files...'
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2048
            itemValue: removeBakAndSavFiles
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  2049
          )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2050
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2051
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2052
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2053
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2054
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2055
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2056
newMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2057
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2058
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2059
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2060
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2061
     the MenuEditor may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2064
     MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2065
     (Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2066
    "
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
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2069
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2070
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2071
     #(#Menu
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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2074
            #label: 'Directory...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2075
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2076
            #value: #newDirectory
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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2079
            #label: 'File...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2080
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2081
            #value: #newFile
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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2084
            #label: 'Hard Link...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2085
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2086
            #value: #newHardLink
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2087
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2088
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2089
            #label: 'Symbolic Link...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2090
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2091
            #value: #newSoftLink
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2092
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2093
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2094
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2095
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2098
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2099
scmMenuSlice
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2100
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2101
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2102
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2103
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2104
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2105
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2108
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#scmMenuSlice
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2109
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser scmMenuSlice)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2110
    "
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
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2113
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2114
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2115
     #(Menu
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2118
            label: 'CVS'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2119
            isVisible: cvsMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2120
            submenuChannel: cvsMenu
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2123
            label: 'SVN'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2124
            isVisible: svnMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2125
            submenuChannel: svnMenu
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2128
            label: 'Mercurial'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2129
            isVisible: mercurialMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2130
            submenuChannel: mercurialMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2131
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2132
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2133
            label: 'HG'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2134
            isVisible: hgMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2135
            submenuChannel: hgMenu
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2138
            label: 'Perforce'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2139
            isVisible: perforceMenusAreShown
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2140
            submenuChannel: perforceMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2141
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2142
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2143
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2144
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2147
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2148
showMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2149
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2150
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2151
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2152
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2153
     the MenuEditor may not be able to read the specification."
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2156
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2157
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2158
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2159
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2160
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2161
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2162
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2163
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2164
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2165
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2166
            label: 'Hidden Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2167
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2168
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2169
            indication: showHiddenFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2170
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2171
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2172
            label: '-'
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: 'Directory Tree'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2176
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2177
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2178
            indication: showDirectoryTree
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2179
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2180
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2181
            label: 'Regular Files in TreeView (Left)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2182
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2183
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2184
            indication: viewFilesInDirectoryTree
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2185
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2186
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2187
            label: 'Directories in ContentsView (Right)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2188
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2189
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2190
            indication: viewDirsInContentsBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2191
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2192
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2193
            enabled: enableViewNoteBookApplication
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2194
            label: 'File Applications'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2195
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2196
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2197
            indication: viewNoteBookApplicationHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2198
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2199
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2200
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2201
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2202
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2203
            label: 'DiskUsage'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2204
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2205
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2206
            indication: showDiskUsageHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2207
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2208
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2209
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2210
        nil
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2214
showMenuSpecForDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2215
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2216
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2219
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2220
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
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2223
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp
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
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2227
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
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2230
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2231
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2232
            label: 'Hidden Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2233
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2234
            hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2235
            indication: showHiddenFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2236
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2237
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2238
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2239
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2240
      )
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2243
sortMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2244
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2245
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2246
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2247
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2248
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2249
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2250
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2251
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2252
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2253
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2254
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2255
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2256
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2257
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2258
     #(#Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2259
        #(
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2260
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2261
            #label: 'By Filename'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2262
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2263
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2264
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2265
            #choiceValue: #baseName
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2266
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2267
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2268
            #label: 'By Extension'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2269
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2270
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2271
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2272
            #choiceValue: #suffix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2273
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2274
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2275
            #label: 'By Permissions'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2276
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2277
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2278
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2279
            #choiceValue: #permissions
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2280
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2281
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2282
            #label: 'By Owner'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2283
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2284
            #isVisible: #viewOwner
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2285
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2286
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2287
            #choiceValue: #owner
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: 'By Group'
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
            #isVisible: #viewOwner
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2293
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2294
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2295
            #choiceValue: #group
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2296
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2297
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2298
            #label: 'By Size'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2299
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2300
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2301
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2302
            #choiceValue: #fileSize
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2303
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2304
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2305
            #label: 'By Date && Time'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2306
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2307
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2308
            #choice: #sortBlockProperty
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2309
            #choiceValue: #modificationTime
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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2312
            #label: '-'
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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2315
            #label: 'Ignore Case in Sort'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2316
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2317
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2318
            #indication: #sortCaseless
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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2321
            #label: 'Directories before Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2322
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2323
            #hideMenuOnActivated: false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2324
            #indication: #sortDirectoriesBeforeFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2325
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2326
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2327
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2328
        nil
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2331
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2332
toolsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2333
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2334
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2335
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2336
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2337
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2338
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
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2341
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2342
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2343
    "
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
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2346
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2347
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2348
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2349
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2350
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2351
            label: 'Open (Win32-Shell)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2352
            itemValue: doOpenWithShellCommand
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2353
            isVisible: systemIsDOS
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2354
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2355
         (MenuItem
18013
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2356
            label: 'Open (OSX-Application)'
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2357
            itemValue: doOpenWithShellCommand
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2358
            isVisible: systemIsOSX
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2359
          )
9e620ee2fae4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17997
diff changeset
  2360
         (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2361
            label: 'Execute UNIX Command...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2362
            itemValue: doExecuteCommand
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2363
            isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2364
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2365
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2366
            label: 'Execute DOS Command...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2367
            itemValue: doExecuteCommand
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2368
            isVisible: systemIsDOS
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2369
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2370
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2371
            label: 'Execute Script...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2372
            itemValue: doExecuteScript
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2373
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2374
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2375
            enabled: canDoTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2376
            label: 'Shell Terminal'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2377
            itemValue: openTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2378
            isVisible: canDoTerminalAndSystemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2379
            labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal')
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2380
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2381
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2382
            enabled: canDoTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2383
            label: 'DOS Terminal'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2384
            itemValue: openTerminal
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2385
            isVisible: canDoTerminalAndSystemIsDOS
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2386
            labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal')
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2387
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2388
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2389
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2390
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2391
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2392
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2393
            label: 'Changes Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2394
            itemValue: openChangesBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2395
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2396
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2397
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2398
            label: 'ChangeSet Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2399
            itemValue: openChangeSetBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2400
            isVisible: changeSetBrowserItemVisible
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2401
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2402
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2403
            enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2404
            label: 'Workspace'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2405
            itemValue: openWorkspace
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2406
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2407
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2408
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2409
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2410
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2411
            enabled: canReadAbbrevFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2412
            label: 'Install Autoloaded'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2413
            itemValue: readAbbrevFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2414
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2415
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2416
            enabled: anySTFilesPresent
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2417
            label: 'Install all ST-Files as Autoloaded'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2418
            itemValue: installAllAsAutoloaded
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
            enabled: recursiveAnySTFilesPresent
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2422
            label: 'Recursive Install all ST-Files as Autoloaded'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2423
            itemValue: installAllAsAutoloadedRecursive
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
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2427
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2428
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2429
            enabled: hasJava
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2430
            label: 'Add Directory to Java Source Path (stx:libjava)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2431
            itemValue: addDirToJavaSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2432
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2433
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2434
            enabled: hasJava
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2435
            label: 'Add Selected Files to Java Source Path (stx:libjava)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2436
            itemValue: fileAddToJavaSourcePath
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2437
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2438
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2439
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2440
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2441
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2442
            label: 'File Operations'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2443
            submenuChannel: fileOpMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2444
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2445
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2446
            label: 'File Utilities'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2447
            submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2448
           (Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2449
              (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2450
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2451
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2452
                  label: 'Editor'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2453
                  itemValue: openEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2454
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2455
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2456
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2457
                  label: 'HTML Reader'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2458
                  itemValue: openHTMLReader
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2459
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2460
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2461
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2462
                  label: 'Web Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2463
                  itemValue: openWebBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2464
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2465
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2466
                  label: 'XML Inspector'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2467
                  itemValue: inspectXmlFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2468
                  isVisible: hasXml
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2469
                  showBusyCursorWhilePerforming: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2470
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2471
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2472
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2473
                  label: 'Acroread (PDF Viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2474
                  itemValue: openPDFViewer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2475
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2476
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2477
                  enabled: hasASN1AndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2478
                  label: 'ASN1 Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2479
                  itemValue: openASN1Browser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2480
                  isVisible: hasASN1
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2481
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2482
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2483
                  enabled: hasCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2484
                  label: 'C Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2485
                  itemValue: openCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2486
                  isVisible: hasCBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2487
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2488
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2489
                  enabled: canOpenMonticelloBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2490
                  label: 'Monticello Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2491
                  itemValue: doOpenMonticelloBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2492
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2493
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2494
                  enabled: hasJavaAndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2495
                  label: 'Applet Viewer'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2496
                  itemValue: openAppletViewer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2497
                  isVisible: hasJava
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2498
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2499
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2500
                  enabled: hasMP3PlayerAndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2501
                  label: 'MP3 Player'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2502
                  itemValue: openMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2503
                  isVisible: hasMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2504
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2505
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2506
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2507
                  label: 'xv (Image Viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2508
                  itemValue: openXV
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2509
                  isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2510
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2511
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2512
                  enabled: currentFilesAreInSameDirectory
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2513
                  label: 'Slide Show'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2514
                  itemValue: openSlideShow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2515
                  isVisible: hasSlideShow
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2516
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2517
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2518
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2519
                  label: 'gv (Postscript Viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2520
                  itemValue: openGV
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2521
                  isVisible: systemIsUnix
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: hasMP3PlayerAndSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2525
                  label: 'MP3 Player'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2526
                  itemValue: openMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2527
                  isVisible: hasMP3Player
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2528
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2529
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2530
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2531
                  label: 'Realplay (avi viewer)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2532
                  itemValue: openRP
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2533
                  isVisible: systemIsUnix
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2534
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2535
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2536
                  label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2537
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2538
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2539
                  label: 'Smalltalk'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2540
                  submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2541
                 (Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2542
                    (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2543
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2544
                        enabled: hasSnapshotSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2545
                        label: 'Snapshot Image Browser'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2546
                        itemValue: openSnapshotImageBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2547
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2548
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2549
                        enabled: canCreateNewProject
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2550
                        label: 'Create Smalltalk Project'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2551
                        itemValue: createProjectAndOpenProjectBrowser
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2552
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2553
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2554
                        label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2555
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2556
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2557
                        enabled: hasResourceFileSelected
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2558
                        label: 'Show Contents of Resourcefile'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2559
                        itemValue: readAndShowResources
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2560
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2561
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2562
                        enabled: hasResourceFileSelected
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2563
                        label: 'Resource File Editor'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2564
                        itemValue: openResourceFileEditor
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2565
                        showBusyCursorWhilePerforming: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2566
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2567
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2568
                        label: '-'
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: 'Contents as ByteArray'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2573
                        itemValue: fileContentsAsByteArray
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2574
                      )
18426
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2575
                     (MenuItem
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2576
                        label: '-'
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2577
                      )
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2578
                     (MenuItem
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2579
                        enabled: hasFileSelection
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2580
                        label: 'Changes from GNU Smalltalk Source'
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2581
                        itemValue: changeSetFromGSTSource
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  2582
                      )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2583
                     )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2584
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2585
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2586
                  )
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
                  label: 'Image'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2590
                  submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2591
                 (Menu
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: 'Image Editor'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2596
                        itemValue: openImageEditor
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
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2599
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2600
                        label: 'Image Preview'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2601
                        itemValue: openImagePreview
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2604
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2605
                        label: 'Image Inspector'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2606
                        itemValue: openImageInspector
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2607
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2608
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2609
                        label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2610
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2611
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2612
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2613
                        label: 'Convert to GIF'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2614
                        itemValue: convertImageToGIF
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2615
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2616
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2617
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2618
                        label: 'Convert to PNG'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2619
                        itemValue: convertImageToPNG
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2620
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2621
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2622
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2623
                        label: 'Convert to XPM'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2624
                        itemValue: convertImageToXPM
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2625
                      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2626
                     (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2627
                        enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2628
                        label: 'Convert to JPG'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2629
                        itemValue: convertImageToJPG
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
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2633
                    nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2634
                  )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2635
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2636
               (MenuItem
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2637
                  label: 'Web'
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2638
                  submenu: 
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2639
                 (Menu
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2640
                    (
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2641
                     (MenuItem
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2642
                        label: 'Fetch File by URL...'
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2643
                        itemValue: fetchFileByURL
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2644
                      )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2645
                     )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2646
                    nil
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2647
                    nil
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2648
                  )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2649
                )
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  2650
               (MenuItem
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2651
                  enabled: hasZipFileSelectedHolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2652
                  label: 'ZipFile Tool'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2653
                  itemValue: openZipTool
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2656
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2657
                  label: 'Hex Dump'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2658
                  itemValue: fileHexDump
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2659
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2660
               )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2661
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2662
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2663
            )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2664
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2665
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2666
            label: 'Find'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2667
            submenu: 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2668
           (Menu
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
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2671
                  label: 'File...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2672
                  itemValue: fileFindFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2673
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2674
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2675
                  enabled: hasFileSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2676
                  label: 'Same Contents as Selected...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2677
                  itemValue: fileFindDuplicateFile
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2678
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2679
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2680
                  label: 'Duplicate Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2681
                  itemValue: fileFindDuplicates
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2682
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2683
               (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2684
                  enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2685
                  label: 'All Duplicate Files (Recursive)'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2686
                  itemValue: fileFindAllDuplicates
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2687
                )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2688
               (MenuItem
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2689
                  label: 'Similar Image Files (by Colors)'
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2690
                  itemValue: fileFindSimilarImages
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2691
                  isVisible: hasImageColorHistogram
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2692
                )
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2693
               (MenuItem
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2694
                  label: 'Similar Image Files (by Form)'
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2695
                  itemValue: fileFindSimilarImagesByForm
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2696
                  isVisible: hasImageHistogram
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  2697
                )
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2698
               )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2699
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2700
              nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2701
            )
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
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2708
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2709
viewDetailsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2710
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2711
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2712
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2713
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2714
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2715
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2716
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2717
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2718
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2721
    <resource: #menu>
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
     #(#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
         #(#MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2727
            #label: '-'
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: 'Hidden Files'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2731
            #translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2732
            #indication: #showHiddenFiles
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
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2735
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2736
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2737
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2738
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2739
11144
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  2740
!AbstractFileBrowser class methodsFor:'menu specs-scm'!
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  2741
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2742
cvsMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2743
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2744
     by the MenuEditor of ST/X."
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
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2747
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2748
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2749
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
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2752
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2755
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2756
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2757
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2758
     #(Menu
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: 'Commit (CVS)...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2762
            itemValue: cvsCommit
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
            enabled: canCvsAddAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2767
            label: 'Add && Commit...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2768
            itemValue: cvsAddAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2769
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2770
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2771
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2772
            enabled: canCvsAddAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2773
            label: 'Add as Binary && Commit...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2774
            itemValue: cvsAddBinaryAndCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2775
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2776
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2777
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2778
            label: 'Commit Folder (CVS)...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2779
            itemValue: cvsCommitFolder
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2780
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2781
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2782
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2783
            label: '-'
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: 'Update selected Files/Directories'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2788
            itemValue: cvsUpdateSelection
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: 'Update Directory Local'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2793
            itemValue: cvsUpdateAll
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2794
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2795
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2796
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2797
            label: 'Update Directory Recursive'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2798
            itemValue: cvsUpdateAllRecursive
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2799
            translateLabel: true
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2802
            label: '-'
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2805
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2806
            label: 'Tag...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2807
            itemValue: cvsTagSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2808
            translateLabel: true
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2811
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2812
            label: 'Revision Log'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2813
            itemValue: cvsRevisionLog
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2814
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2815
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2816
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2817
            enabled: hasSelection
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2818
            label: 'Compare with newest in Repository'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2819
            itemValue: cvsCompareWithNewest
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2820
            translateLabel: true
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2823
            label: '-'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2824
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2825
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2826
            enabled: canRemoveCVSContainer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2827
            label: 'Remove File && CVS Container...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2828
            itemValue: cvsRemoveFileAndCVSContainer
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2829
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2830
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2831
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2832
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2833
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2834
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2835
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2836
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2837
mercurialMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2838
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2839
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2840
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2841
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2842
     the MenuEditor may not be able to read the specification."
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
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2845
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2846
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2847
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2848
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2849
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2850
    <resource: #menu>
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
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2854
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2855
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2856
            label: 'Add'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2857
            itemValue: mercurialAdd
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2858
            translateLabel: true
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2861
            label: 'Commit Changes'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2862
            itemValue: mercurialCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2863
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2864
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2865
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2866
            label: 'Push...'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2867
            itemValue: mercurialPush
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2868
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2869
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2870
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2871
            label: 'Status'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2872
            itemValue: mercurialStatus
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2873
            translateLabel: true
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
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2876
            label: '-'
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: 'Init'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2880
            itemValue: mercurialInit
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
    "Modified: / 17-01-2012 / 15:57:40 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2889
!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2890
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2891
perforceMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2892
    "This resource specification was automatically generated
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2893
     by the MenuEditor of ST/X."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2894
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2895
    "Do not manually edit this!! If it is corrupted,
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2896
     the MenuEditor may not be able to read the specification."
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2897
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2898
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2899
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2900
     MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2901
     (Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2902
    "
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2903
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2904
    <resource: #menu>
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2905
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2906
    ^ 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2907
     #(Menu
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2908
        (
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2909
         (MenuItem
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2910
            label: 'Commit'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2911
            itemValue: perforceCommit
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2912
            translateLabel: true
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2913
          )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2914
         )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2915
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2916
        nil
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2917
      )
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2918
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2919
    "Created: / 15-01-2012 / 13:12:30 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  2920
! !
11144
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  2921
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  2922
!AbstractFileBrowser class methodsFor:'misc'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  2923
321c1729db5b initial checkin
penk
parents:
diff changeset
  2924
newLock
321c1729db5b initial checkin
penk
parents:
diff changeset
  2925
    ^ CodeExecutionLock new
321c1729db5b initial checkin
penk
parents:
diff changeset
  2926
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  2927
17288
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2928
!AbstractFileBrowser class methodsFor:'queries'!
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2929
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2930
isAbstract
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2931
    ^ self == AbstractFileBrowser
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2932
! !
37a31feda2e4 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17252
diff changeset
  2933
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2934
!AbstractFileBrowser class methodsFor:'queries-file'!
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2935
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2936
getBestDirectoryFrom:directories
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2937
    "from a set of directories, return the common parent directory"
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2938
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2939
    |stringCol firstPre|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2940
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2941
    directories isEmpty ifTrue:[^ nil].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2942
    directories size == 1 ifTrue:[^ directories first].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2943
    stringCol := (directories collect:[:file| file asString]) asOrderedCollection.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2944
    firstPre := stringCol at:1.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2945
    stringCol from:2 do:[:el|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2946
         firstPre :=  firstPre commonPrefixWith:el.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2947
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2948
    (firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2949
        firstPre removeLast.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2950
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2951
    ^ firstPre asFilename
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2952
! !
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  2953
17746
7b5d6fc64fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17744
diff changeset
  2954
!AbstractFileBrowser class methodsFor:'utilities - dump'!
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  2955
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  2956
contentsOfBytesAsDump:dataOrFileStream base:numberBase numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2957
    "utility helper: generate a hexDump with addresses;
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2958
     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
  2959
     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
  2960
     to support display of alien encoded binary data."
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2961
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  2962
    |dataSize lines nHexLines replacementForUnprintable colsPerByte characterDecoder|
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2963
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2964
    (characterEncodingSymbol isNil or:[characterEncodingSymbol == #'iso8859-1']) ifFalse:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2965
        characterDecoder := CharacterEncoder encoderToEncodeFrom:characterEncodingSymbol into:#unicode.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2966
    ].    
17252
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2967
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2968
    "/ used to be:
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2969
    "/ replacementForUnprintable := $.
1182be543bb2 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17239
diff changeset
  2970
    replacementForUnprintable := Character value:16rB7. "/ a centered dot.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2971
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2972
    "/ cols needed per byte in the hex dump
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2973
    colsPerByte := ((255 printStringRadix:numberBase) size).
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2974
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2975
    "generate a virtual collection which evaluates and returns lines on-demand"
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  2976
    dataSize := dataOrFileStream isStream
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  2977
                    ifTrue:[ dataOrFileStream fileSize ]
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  2978
                    ifFalse:[ dataOrFileStream size ].
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  2979
    nHexLines := (dataSize + 15) // 16.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2980
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2981
    lines := VirtualArray new.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2982
    lines setSize:nHexLines + (nHexLines // 16).
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2983
    lines 
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2984
        generator:[:lineNr |
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2985
            |blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2986
             decodedChar charPrinted|
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2987
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2988
            blockNr := (lineNr - 1) // 17.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2989
            lineNrInBlock := (lineNr - 1) \\ 17.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2990
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2991
            lineNrInBlock == 16 ifTrue:[
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2992
                line := ''
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2993
            ] ifFalse:[
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2994
                startOffset := ((blockNr * 16) + lineNrInBlock) * 16.
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2995
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  2996
                "/ 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
  2997
                lineStream := String writeStream.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2998
                asciiLineStream := String writeStream.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  2999
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3000
                lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits).
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3001
                lineStream nextPutAll:': '.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3002
                1 to:16 do:[:i |
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3003
                    i ~~ 1 ifTrue:[ lineStream space ].
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3004
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3005
                    (startOffset + i) > dataSize ifTrue:[
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3006
                        asciiLineStream nextPut:(Character space).
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3007
                        lineStream spaces:colsPerByte.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3008
                    ] ifFalse:[
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3009
                        dataOrFileStream isStream ifTrue:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3010
                            dataOrFileStream position:(startOffset + i - 1).
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3011
                            byte := dataOrFileStream nextByte.
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3012
                        ] ifFalse:[    
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3013
                            byte := dataOrFileStream at:startOffset + i.
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3014
                        ].
17746
7b5d6fc64fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17744
diff changeset
  3015
                        lineStream nextPutAll:(byte printStringRadix:numberBase size:colsPerByte fill:$0).
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3016
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3017
                        
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3018
                        decodedChar := byte.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3019
                        characterDecoder notNil ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3020
                            decodedChar := characterDecoder encode:byte.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3021
                        ].    
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3022
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3023
                        charPrinted := replacementForUnprintable.
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3024
                        decodedChar notNil ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3025
                            ((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
  3026
                                charPrinted := Character value:decodedChar.
16188
26fe162be79f #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 16160
diff changeset
  3027
                            ] ifFalse:[
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3028
                                (decodedChar between:0 and:31) ifTrue:[
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3029
                                    "/ the 'nul', 'soh' .. 'gs' chars in unicodePage 2400
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3030
                                    "/ are perfect here, but usually not available in the font
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3031
                                    "/ and we have currently no way of knowing if they are...
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3032
                                    "/ (could let the font draw into a bitmap and check if there is something...)
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3033
                                    "/ For now, write a dot.·
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3034
                                    "/ charPrinted := (Character value:(byte + 16r2400))
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3035
                                ].
16188
26fe162be79f #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 16160
diff changeset
  3036
                            ].
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3037
                        ].
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3038
                        asciiLineStream nextPut:charPrinted.
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3039
                    ].
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3040
                ].
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3041
                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
  3042
                        , asciiLineStream contents.
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3043
            ].
11281
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3044
            line
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3045
        ].
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3046
    ^ lines.
1064ace6fbfa changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents: 11262
diff changeset
  3047
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3048
    "Created: / 12-11-2017 / 11:24:29 / cg"
17750
c55331a80c13 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17746
diff changeset
  3049
    "Modified: / 12-11-2017 / 14:17:59 / cg"
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3050
    "Modified: / 12-03-2019 / 16:16:53 / Claus Gittinger"
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3051
!
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3052
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3053
contentsOfBytesAsHexDump:dataOrFileStream numberOfAddressDigits:addrDigits addressStart:virtualStart
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3054
    "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
  3055
     the iso8859-1 characters"
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3056
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3057
    ^ self
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3058
        contentsOfBytesAsDump:dataOrFileStream base:16
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3059
        numberOfAddressDigits:addrDigits
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3060
        addressStart:virtualStart
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3061
        characterEncoding:#'iso8859-1'
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3062
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3063
    "Created: / 13-02-2012 / 15:01:46 / cg"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3064
    "Modified: / 12-11-2017 / 12:07:12 / cg"
17753
b8b1073d9506 #BUGFIX by mawalch
mawalch
parents: 17750
diff changeset
  3065
    "Modified: / 14-11-2017 / 17:48:19 / mawalch"
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3066
    "Modified (format): / 12-03-2019 / 16:38:26 / Claus Gittinger"
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3067
!
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3068
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3069
contentsOfBytesAsHexDump:dataOrFileStream numberOfAddressDigits:addrDigits addressStart:virtualStart characterEncoding:characterEncodingSymbol 
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3070
    "utility helper: generate a hexDump with addresses;
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3071
     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
  3072
     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
  3073
     to support display of alien encoded binary data."
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3074
    
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3075
    ^ self 
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3076
        contentsOfBytesAsDump:dataOrFileStream base:16
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3077
        numberOfAddressDigits:addrDigits
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3078
        addressStart:virtualStart
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3079
        characterEncoding:characterEncodingSymbol
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3080
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3081
    "Created: / 12-11-2017 / 11:21:44 / cg"
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3082
    "Modified (format): / 12-03-2019 / 16:38:31 / Claus Gittinger"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3083
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3084
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3085
contentsOfFileAsDump:f base:numberBase withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3086
    "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
  3087
    
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3088
    |resources fileName stream data offs 
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3089
     addrDigits lines answer sizeLimit showLastPart setNewLimit thisFileSizeString|
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3090
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3091
    resources := self classResources.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3092
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3093
    fileName := f baseName.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3094
    f isDirectory ifTrue:[
18609
8e78a084139c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18578
diff changeset
  3095
        Dialog warn:(resources string:'"%1" is a directory.' with:fileName).
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3096
        ^ nil
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3097
    ].
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3098
    f exists ifFalse:[
18609
8e78a084139c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18578
diff changeset
  3099
        Dialog warn:(resources string:'oops, "%1" is gone or unreadable.' with:fileName).
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3100
        ^ nil
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
    f isReadable ifFalse:[
18609
8e78a084139c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18578
diff changeset
  3103
        Dialog warn:(resources string:'"%1" is unreadable.' with:fileName).
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3104
        ^ nil
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3105
    ].
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3106
    f fileSize > (self maxFileSizeShownWithoutAsking) ifTrue:[
8472
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3107
        limitOrNil notNil ifTrue:[
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3108
            sizeLimit := limitOrNil.
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3109
            showLastPart := showLastPartOrNil
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3110
        ] ifFalse:[
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3111
            setNewLimit := false.
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3112
            thisFileSizeString := (UnitConverter fileSizeStringFor:f fileSize).
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3113
            
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3114
            Dialog 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3115
                withOptoutOption:[ setNewLimit := true ]
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3116
                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
  3117
                do:[
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3118
                    answer := Dialog 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3119
                                    confirmWithCancel:(resources
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3120
                                                        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
  3121
                                                        with:(fileName contractTo:40) allBold 
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3122
                                                        with:thisFileSizeString)
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3123
                                    labels:#('Cancel' 'Show All' 'Show First Part' ).
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3124
                ].
8472
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3125
            answer isNil ifTrue:[^ nil].
8673c279211b last part of big files
Claus Gittinger <cg@exept.de>
parents: 8462
diff changeset
  3126
            answer ifTrue:[
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  3127
                sizeLimit := (4 * 1024 * 1024) "max:self maxFileSizeShownWithoutAsking".
17768
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3128
            ] ifFalse:[
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3129
                setNewLimit ifTrue:[
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3130
                    self maxFileSizeShownWithoutAsking:(self maxFileSizeShownWithoutAsking max:f fileSize).
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3131
                ].    
dde98b4c9580 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17762
diff changeset
  3132
            ].    
8436
9d37d5a998ca long hex dumps
Claus Gittinger <cg@exept.de>
parents: 8426
diff changeset
  3133
        ].
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3134
    ].
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3135
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3136
    [
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3137
        stream := f readStream binary.
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3138
        sizeLimit notNil ifTrue:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3139
            showLastPart == true ifTrue:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3140
                stream position:(f fileSize - sizeLimit).
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3141
            ].
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3142
            data := stream nextBytes:sizeLimit.
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3143
        ] ifFalse:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3144
            f fileSize > (1024*1024) ifTrue:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3145
                data := stream
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3146
            ] ifFalse:[    
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3147
                data := stream contents.
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3148
            ].
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3149
        ].
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3150
    ] ensure:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3151
        (stream notNil and:[stream ~~ data]) ifTrue:[
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3152
            stream close.
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3153
        ].
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3154
    ].
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3155
    
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3156
    offs := 0.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3157
    lines := StringCollection new.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3158
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3159
    addrDigits := ((f fileSize + 1) log:16) truncated + 1.
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3160
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3161
    ^ self 
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3162
        contentsOfBytesAsDump:data base:numberBase
11262
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3163
        numberOfAddressDigits:addrDigits
b7f40ea56d26 extracted utility:
Claus Gittinger <cg@exept.de>
parents: 11176
diff changeset
  3164
        addressStart:0
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3165
        characterEncoding:characterEncoding
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3166
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3167
    "Created: / 12-11-2017 / 12:08:10 / cg"
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  3168
    "Modified: / 19-11-2017 / 15:01:34 / cg"
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  3169
    "Modified: / 12-03-2019 / 16:18:46 / Claus Gittinger"
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3170
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3171
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3172
contentsOfFileAsHexDump:f 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3173
    "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
  3174
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3175
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3176
        contentsOfFileAsHexDump:f
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3177
        withLimit:nil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3178
        lastPart:nil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3179
        characterEncoding:#'iso8859-1'
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3180
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3181
    "Modified (comment): / 12-11-2017 / 12:09:30 / cg"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3182
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3183
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3184
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3185
    "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
  3186
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3187
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3188
        contentsOfFileAsHexDump:f
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3189
        withLimit:limitOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3190
        lastPart:showLastPartOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3191
        characterEncoding:#'iso-8859-1'
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3192
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3193
    "Modified (comment): / 12-11-2017 / 12:09:34 / cg"
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3194
!
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3195
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3196
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil characterEncoding:characterEncoding 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3197
    "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
  3198
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3199
    ^ self 
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3200
        contentsOfFileAsDump:f base:16
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3201
        withLimit:limitOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3202
        lastPart:showLastPartOrNil
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3203
        characterEncoding:characterEncoding
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3204
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  3205
    "Created: / 12-11-2017 / 12:02:05 / cg"
4610
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3206
! !
778225bac483 hexDump as utility
Claus Gittinger <cg@exept.de>
parents: 4593
diff changeset
  3207
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3208
!AbstractFileBrowser class methodsFor:'utilities - files'!
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3209
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3210
allFilesInDirectories:directories forWhich:aBlock
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3211
    |allFiles|
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
    directories isEmpty ifTrue:[^ #()].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3214
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3215
    allFiles := OrderedCollection new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3216
    directories do:[:dir|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3217
        [
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3218
            |fileNames|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3219
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3220
            fileNames := dir directoryContents.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3221
            fileNames notNil ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3222
                fileNames := fileNames 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3223
                                collect:[:fn | dir construct:fn]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3224
                                thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3225
                allFiles addAll:fileNames.
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
        ] on:FileStream openErrorSignal do:[:ex|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3228
            self warn:(self classResources stringWithCRs:'Cannot access: %1\(%2)' 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3229
                            with:ex pathName
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3230
                            with:ex description).
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3231
            ex proceedWith:nil.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3232
        ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3233
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3234
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3235
    ^ allFiles
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3236
!
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3237
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3238
fileFindDuplicatesIn:directories
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3239
    "scan directories for duplicate files.
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  3240
     return a dictionary mapping duplicate files to their original;
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  3241
     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
  3242
     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
  3243
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3244
    |infoDir filesBySize anySameSized 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3245
     result allFiles|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3246
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3247
    directories isEmpty ifTrue:[^ #()].
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
    allFiles := self allFilesInDirectories:directories forWhich:[:f | true].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3250
    allFiles isEmpty ifTrue:[^ #()].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3251
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3252
    "/ for each, get the file's info (size, modificationTime etc.).
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3253
    infoDir := Dictionary new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3254
    allFiles do:[:fn |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3255
        infoDir at:fn put:(fn info)
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3256
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3257
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3258
    "/ in a first pass, collect groups by the same size
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3259
    "/ remember those fileSizes for which multiple files exist
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3260
    filesBySize := Dictionary new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3261
    anySameSized := false.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3262
    infoDir keysAndValuesDo:[:fn :info |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3263
        |sz entry|
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
        sz := info fileSize.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3266
        entry := filesBySize at:sz ifAbsentPut:[Set new].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3267
        entry add:fn.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3268
        entry size > 1 ifTrue:[ anySameSized := true ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3269
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3270
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3271
    "/ any of same size ?
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3272
    anySameSized ifFalse:[^ #() ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3273
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3274
    result := Dictionary new.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3275
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3276
    "/ now walk over the same-sized files and compare the contents.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3277
    filesBySize do:[:entry |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3278
        |files|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3279
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3280
        entry size > 1 ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3281
            files := entry asArray.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3282
            files 
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3283
                sort:[:a :b |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3284
                    |tA tB|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3285
                    tA := (infoDir at:a) modificationTime.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3286
                    tB := (infoDir at:b) modificationTime.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3287
                    tA < tB
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3288
                ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3289
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3290
            1 to:files size-1 do:[:idx1 |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3291
                |fn1|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3292
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3293
                fn1 := files at:idx1.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3294
                idx1+1 to:files size do:[:idx2 |
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3295
                    |fn2|
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3296
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3297
                    fn2 := files at:idx2.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3298
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3299
                    (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3300
                        "/ compare the files
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3301
                        (fn1 sameContentsAs:fn2) ifTrue:[
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3302
                            "/ 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
  3303
                            result at:fn2 put:fn1.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3304
                        ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3305
                    ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3306
                ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3307
            ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3308
        ]
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3309
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3310
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3311
    result := result associations copy.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3312
"/    result := result collect:[:assoc |
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3313
"/                                    |f1 f2|
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3314
"/
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3315
"/                                    f1 := assoc key asString.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3316
"/                                    f2 := assoc value asString.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3317
"/                                    f1 < f2 ifTrue:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3318
"/                                        f2 -> f1
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3319
"/                                    ] ifFalse:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3320
"/                                        f1 -> f2
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3321
"/                                    ]
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  3322
"/                            ].
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3323
    "/ 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
  3324
    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
  3325
    result sort:[:f1 :f2 | f1 key < f2 key].
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3326
    ^ result
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3327
! !
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  3328
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3329
!AbstractFileBrowser methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3330
321c1729db5b initial checkin
penk
parents:
diff changeset
  3331
askForCommandFor:fileName thenDo:aBlock
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  3332
    "setup and launch a querybox to ask for a unix command.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3333
     Then evaluate aBlock passing the command-string as argument."
321c1729db5b initial checkin
penk
parents:
diff changeset
  3334
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3335
    |box osName commandString alwaysOpenLikeThisHolder openCmd suffix|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3336
321c1729db5b initial checkin
penk
parents:
diff changeset
  3337
    osName := OperatingSystem platformName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3338
321c1729db5b initial checkin
penk
parents:
diff changeset
  3339
    box := FilenameEnterBox 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3340
                title:(resources string:'Execute %1 command:' with:osName)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3341
               okText:(resources string:'Execute')
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3342
               action:[:cmd | commandString := cmd].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3343
321c1729db5b initial checkin
penk
parents:
diff changeset
  3344
    fileName notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3345
        self initialCommandFor:fileName into:box.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3346
    ].
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3347
    alwaysOpenLikeThisHolder := false asValue.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3348
    box verticalPanel add:((CheckBox label:'Always use this command for this file type') model:alwaysOpenLikeThisHolder).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3349
    box directory:(self getDirWithoutFileName:fileName).
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3350
    box open.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3351
    
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3352
    "/ box destroy.
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3353
    alwaysOpenLikeThisHolder value ifTrue:[
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3354
        openCmd := commandString upTo:$".
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3355
        suffix := fileName suffix.
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3356
        UserPreferences current 
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3357
            defaultFileOpenCommandFor:suffix put:(openCmd,' "%1"');
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3358
            beModified.
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  3359
        self breakPoint:#cg.
16160
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3360
    ].
ed6b8b5cb2d4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16102
diff changeset
  3361
    
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3362
    commandString notNil ifTrue:[
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3363
        aBlock value:commandString
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3364
    ].
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  3365
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3366
    "Modified: / 7.9.1995 / 10:31:54 / claus"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3367
    "Modified: / 16.9.1997 / 15:35:10 / stefan"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3368
    "Modified: / 14.8.1998 / 14:12:52 / cg"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3369
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3370
321c1729db5b initial checkin
penk
parents:
diff changeset
  3371
changeFileBrowserTitleTo:aString
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3372
    self 
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3373
        applicationNamed:#FileBrowserV2 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3374
        ifPresentDo:[:app | app changeFileBrowserTitleTo:aString]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3375
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3376
321c1729db5b initial checkin
penk
parents:
diff changeset
  3377
copyFileList
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3378
    "copy the fileList to the clipBoard"
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3379
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3380
    |fileList|
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3381
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3382
    fileList := self 
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3383
                    applicationNamed:#DirectoryContentsBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3384
                    ifPresentDo:[:app | app browserFileList].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3385
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3386
    fileList notNil ifTrue:[
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3387
        self copyFileListToClipBoard:fileList.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3388
    ]
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3389
!
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3390
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3391
copyFileListToClipBoard:fileList
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3392
    "copy the itemList to the clipBoard"
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3393
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3394
    |stream|
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3395
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3396
    fileList isEmpty ifTrue:[^ self].
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3397
5772
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3398
    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
  3399
    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
  3400
        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
  3401
    ] ifFalse:[
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3402
        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
  3403
            (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
  3404
                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
  3405
            ]
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  3406
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3407
    ].
6034
7f7d4b7362dd set selection interface changed
ca
parents: 6031
diff changeset
  3408
    self window setClipboardText:stream contents.
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
copySelectedFilenames
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3412
    "copy the selected fileNames to the clipBoard"
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3413
4973
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3414
    |fileList|
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3415
e4b72eec43d3 refactoring the browserItemList access in directoryContentsBrowser
penk
parents: 4963
diff changeset
  3416
    fileList := self 
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3417
                    applicationNamed:#DirectoryContentsBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3418
                    ifPresentDo:[:appl | appl selectedFileNames].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3419
    fileList notNil ifTrue:[
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3420
        self copyFileListToClipBoard:fileList.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3421
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3422
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3423
10923
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3424
doAddArchiver
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3425
    |files|
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3426
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3427
    files := self currentSelectedFiles.
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3428
    files size == 1 ifFalse:[
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  3429
        Dialog information:(resources string:'Select exactly one archive.').
10923
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3430
        ^ self
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3431
    ].
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3432
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3433
    self 
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3434
        applicationNamed:#FileApplicationNoteBook
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3435
        ifPresentDo:[:appl | appl doAddArchiverOn:files first].
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3436
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3437
    "Created: / 29-11-2011 / 19:01:31 / cg"
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  3438
    "Modified: / 29-11-2017 / 12:25:47 / cg"
10923
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3439
!
dbaaef801020 added: #doAddArchiver
Claus Gittinger <cg@exept.de>
parents: 10915
diff changeset
  3440
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3441
doAddTerminal
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3442
    |dir|
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3443
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3444
    dir := self currentDirectory.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3445
    dir isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3446
        dir :=  Filename homeDirectory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3447
    ].
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  3448
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3449
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3450
        applicationNamed:#FileApplicationNoteBook
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3451
        ifPresentDo:[:appl | appl addTerminalIn:dir].
18734
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  3452
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  3453
    "Modified (format): / 10-04-2019 / 05:53:35 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3454
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3455
321c1729db5b initial checkin
penk
parents:
diff changeset
  3456
doOpenSearchFile
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3457
    |item file|
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3458
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3459
    file := self firstSelectedFileName.
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3460
    file isNil ifTrue:[
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3461
        file := Filename homeDirectory asAbsoluteFilename.
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3462
    ].
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  3463
    item := DirectoryContentsBrowser itemClass fileName:file.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3464
    self openSearchFileOn:item.
321c1729db5b initial checkin
penk
parents:
diff changeset
  3465
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3466
321c1729db5b initial checkin
penk
parents:
diff changeset
  3467
doShowFileContents
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3468
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3469
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3470
        ifPresentDo:[:appl | ^ appl doShowFileContents].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3471
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3472
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3473
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3474
321c1729db5b initial checkin
penk
parents:
diff changeset
  3475
doShowProperties
321c1729db5b initial checkin
penk
parents:
diff changeset
  3476
    "show long stat (file)-info"
321c1729db5b initial checkin
penk
parents:
diff changeset
  3477
321c1729db5b initial checkin
penk
parents:
diff changeset
  3478
    self fileGetInfo:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  3479
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3480
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3481
enterAction
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3482
    self 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3483
        applicationNamed:#DirectoryContentsBrowser 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3484
        ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl enterAction ]].
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3485
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  3486
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3487
fileEncodingDialog
14497
6d95f7c8d28e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14419
diff changeset
  3488
    "open a dialog to allow change of the file's character encoding.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3489
     Files are converted to internal encoding when read, and converted back
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3490
     to this encoding when saved.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3491
     Notice: currently, not too many encodings are supported by the system."
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3492
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3493
    |bindings encodings encodingDescr idx selectedEncoding|
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3494
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3495
    encodingDescr := CharacterEncoder supportedExternalEncodings.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3496
    encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3497
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3498
    bindings := IdentityDictionary new.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3499
    bindings at:#encodingList put:encodingDescr.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3500
    bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue.
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3501
    bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue).
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3502
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3503
    (self openDialogInterface:#encodingDialogSpec withBindings:bindings)
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3504
    ifTrue:[
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3505
        idx := (bindings at:#selectedEncoding) value.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3506
        selectedEncoding := encodings at:idx.
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3507
        selectedEncoding notNil ifTrue:[
5704
82093ade9b35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5673
diff changeset
  3508
            self fileEncoding:selectedEncoding asSymbol.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3509
        ].
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  3510
        self lockFileEncoding:(bindings at:#lockFileEncoding) value.
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3511
    ].
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3512
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3513
    "Modified: 30.6.1997 / 14:41:12 / cg"
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3514
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3515
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3516
gotoFile:aFilename 
5380
2f738f3a34b1 fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3517
    "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
  3518
    
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3519
    |currentFileNameHolder currentSel|
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3520
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3521
    currentFileNameHolder := self currentFileNameHolder.
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3522
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3523
    currentSel := currentFileNameHolder value.
5380
2f738f3a34b1 fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3524
    (currentSel includes:aFilename) ifFalse:[
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3525
        self withWaitCursorDo:[
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3526
            currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)).
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3527
        ]
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3528
    ].
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3529
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3530
    "Modified: / 29-12-2010 / 11:04:29 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3531
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3532
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3533
lineEndConventionDialog
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3534
    "open a dialog to allow change of the line end conventions
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3535
     (when writing files)"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3536
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3537
    |bindings|
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3538
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3539
    bindings := IdentityDictionary new.
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3540
    bindings at:#lineEndConvention put:(self lineEndConvention asValue).
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3541
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3542
    (self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings)
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3543
    ifTrue:[
15208
c02c92b1c524 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15189
diff changeset
  3544
        self lineEndConventionHolder value:(bindings at:#lineEndConvention) value asSymbol
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3545
    ].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3546
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3547
    "Created: / 06-01-2012 / 15:34:51 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3548
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3549
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3550
newTextEditor
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3551
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3552
        applicationNamed:#FileApplicationNoteBook
15936
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3553
        ifPresentDo:[:appl | 
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3554
            |editor files item|
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3555
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3556
            editor := appl newTextEditor.
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3557
            (files := self currentSelectedFiles) size == 1 ifTrue:[
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3558
                item := DirectoryContentsBrowser itemClass fileName:files first.
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3559
                editor item:item.     
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3560
            ].    
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3561
            ^ editor
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  3562
        ].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3563
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3564
    ^ nil.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3565
!
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3566
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3567
openApplByFileItem:anItem
8490
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3568
    "/ q: is the following always wanted ?
9267
a8afd9424514 changed: #openApplByFileItem:
Stefan Vogel <sv@exept.de>
parents: 9206
diff changeset
  3569
    self window sensor shiftDown ifFalse:[
17715
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3570
        ((anItem mimeType startsWith:'application/x-expecco-') 
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3571
         and:[(Smalltalk at:#ExpeccoStartup) notNil]) ifTrue:[
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3572
            (Smalltalk at:#ExpeccoStartup) main:{anItem fileName asString}.
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3573
            ^ self.
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3574
        ].
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3575
10669
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3576
        "/ cg: no - batch and shell scripts are to be
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3577
"/        anItem fileName isExecutableProgram ifTrue:[
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3578
"/            self executeCommand:anItem fileName pathName.
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3579
"/            ^ self.
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3580
"/        ].
9267
a8afd9424514 changed: #openApplByFileItem:
Stefan Vogel <sv@exept.de>
parents: 9206
diff changeset
  3581
8490
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3582
"/        OperatingSystem isMSWINDOWSlike ifTrue:[
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3583
"/            Error handle:[:ex |
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3584
"/            ] do:[
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3585
"/                OperatingSystem
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3586
"/                    shellExecute:nil
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3587
"/                    lpOperation:'open'
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3588
"/                    lpFile:(anItem fileName pathName)
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3589
"/                    lpParameters:nil
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3590
"/                    lpDirectory:(self directory pathName)
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3591
"/                    nShowCmd:#SW_SHOWNORMAL.
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3592
"/                ^ self.
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3593
"/            ]
8bcb3096e3fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8473
diff changeset
  3594
"/        ]
9267
a8afd9424514 changed: #openApplByFileItem:
Stefan Vogel <sv@exept.de>
parents: 9206
diff changeset
  3595
    ].
5306
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
  3596
    ^ self 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3597
        applicationNamed:#FileApplicationNoteBook
5306
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
  3598
        ifPresentDo:[:appl | appl openApplByFileItem:anItem].
10669
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3599
079d85556631 changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents: 10556
diff changeset
  3600
    "Modified: / 06-09-2011 / 11:11:15 / cg"
17715
72492b5581af #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 17686
diff changeset
  3601
    "Modified: / 18-10-2017 / 10:15:15 / stefan"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3602
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3603
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3604
openApplForFile:aFilename
5306
Claus Gittinger <cg@exept.de>
parents: 5300
diff changeset
  3605
    ^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename).
4392
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3606
!
feb0bffd27b8 add new Text Editor tab
penk
parents: 4391
diff changeset
  3607
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3608
openCommandResultApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  3609
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3610
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3611
        applicationNamed:#FileApplicationNoteBook
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3612
        ifPresentDo:[:appl | ^ appl openCommandResultApplication].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3613
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3614
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3615
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3616
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3617
openNewTextEditorOn:anItem
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3618
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3619
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3620
        ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3621
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3622
    ^ nil
4880
87f511659680 edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents: 4878
diff changeset
  3623
!
87f511659680 edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents: 4878
diff changeset
  3624
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3625
openSearchFileOn:anItem
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3626
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3627
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3628
        ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3629
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3630
    ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3631
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3632
5162
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3633
openTextEditorForFile:aFilename
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3634
    ^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename).
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3635
!
f2413a1a747a opening on a file
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
  3636
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3637
openTextEditorOn:anItem
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3638
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3639
        applicationNamed:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3640
        ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3641
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3642
    ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3643
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3644
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3645
openTextEditorOn:anItem type:aDirDescrOrFile
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:#FileApplicationNoteBook
5010
27aa6fa93dcd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5009
diff changeset
  3648
        ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3649
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3650
    ^ nil.
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3651
!
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  3652
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3653
setCurrentFileName:aFilename 
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3654
    self setCurrentFileNames:(OrderedCollection with:aFilename).
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3655
!
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3656
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3657
setCurrentFileNames:aCollectionOfFilenames 
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3658
    self currentFileNameHolder value:aCollectionOfFilenames.
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3659
!
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3660
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3661
tabStopConversionDialog
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3662
    "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
  3663
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3664
    |bindings|
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3665
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3666
    bindings := IdentityDictionary new.
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3667
    bindings at:#tabStops put:(self inputTabColumnConversion asValue).
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3668
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3669
    (self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings)
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3670
    ifTrue:[
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3671
        self inputTabColumnConversionHolder value:(bindings at:#tabStops) value
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3672
    ].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3673
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3674
    "Created: / 06-01-2012 / 15:36:06 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3675
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  3676
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3677
updateAndSelect:aColOfFiles
4785
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  3678
    self updateCurrentDirectory.
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  3679
    aColOfFiles notNil ifTrue:[ 
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  3680
        self setCurrentFileNames:aColOfFiles 
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  3681
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3682
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3683
321c1729db5b initial checkin
penk
parents:
diff changeset
  3684
updateCurrentDirectory
5739
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3685
    self updateCurrentDirectory:false
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3686
!
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3687
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3688
updateCurrentDirectory:withReread
4785
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  3689
    DirectoryContents flushCachedDirectoryFor:(self getBestDirectory).
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  3690
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3691
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3692
        applicationNamed:#DirectoryContentsBrowser 
5739
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3693
        ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]].
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3694
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3695
        applicationNamed:#DirectoryTreeBrowser     
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3696
        ifPresentDo:[:appl | appl doUpdate].
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3697
!
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3698
5739
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3699
updateCurrentDirectoryWithReread
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3700
    self updateCurrentDirectory:true
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3701
!
ec8cb05922b5 update now reread all the items
penk
parents: 5737
diff changeset
  3702
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3703
withActivityIndicationDo:aBlock
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3704
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3705
    self activityVisibilityChannel value:true.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3706
    [
9361
bad1ef34ac86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
  3707
        self withWaitCursorDo:[
bad1ef34ac86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
  3708
            aBlock value.
bad1ef34ac86 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9343
diff changeset
  3709
        ]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3710
    ] ensure:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3711
        self activityVisibilityChannel value:false.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  3712
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3713
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3714
321c1729db5b initial checkin
penk
parents:
diff changeset
  3715
!AbstractFileBrowser methodsFor:'actions bookmarks'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3716
321c1729db5b initial checkin
penk
parents:
diff changeset
  3717
addBookmark
321c1729db5b initial checkin
penk
parents:
diff changeset
  3718
    self currentFilesAreInSameDirectory ifFalse:[^ self].
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3719
    self addBookmarks:(self currentSelectedDirectories).
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  3720
    self class saveBookmarksInDefaultBookmarksFile
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3721
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3722
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3723
addBookmarks:aColOfDirectories
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3724
    aColOfDirectories do:[ :path |
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3725
        self class addBookmark:path
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3726
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3727
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3728
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
  3729
editBookmarks
17849
6b238844d1c0 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17831
diff changeset
  3730
    self class editBookmarksWithDefault: self currentSelectedDirectories firstOrNil.
6b238844d1c0 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17831
diff changeset
  3731
6b238844d1c0 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17831
diff changeset
  3732
    "Modified: / 13-12-2017 / 23:24:39 / stefan"
8013
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
  3733
!
eb4bd1984ca0 editBookmarks
fm
parents: 7990
diff changeset
  3734
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3735
hasBookmarks
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3736
    ^ self class hasBookmarks
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3737
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3738
321c1729db5b initial checkin
penk
parents:
diff changeset
  3739
hasBookmarksToRemove
321c1729db5b initial checkin
penk
parents:
diff changeset
  3740
    |bookmarks directories|
321c1729db5b initial checkin
penk
parents:
diff changeset
  3741
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  3742
    directories := self currentSelectedDirectories.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3743
    bookmarks := self class directoryBookmarks.
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  3744
    ^ (bookmarks notEmptyOrNil and:[directories notEmpty])
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  3745
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  3746
    "Modified: / 17-02-2017 / 08:25:22 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3747
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3748
321c1729db5b initial checkin
penk
parents:
diff changeset
  3749
removeBookmark
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3750
    self currentSelectedDirectories do:[:dir|
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  3751
        self class removeBookmark:dir
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3752
    ].
4679
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3753
!
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3754
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3755
saveBookmarks
b2fd1d45a7c9 save bookmarks;
Claus Gittinger <cg@exept.de>
parents: 4672
diff changeset
  3756
     self class saveBookmarks
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3757
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3758
321c1729db5b initial checkin
penk
parents:
diff changeset
  3759
!AbstractFileBrowser methodsFor:'actions history'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3760
321c1729db5b initial checkin
penk
parents:
diff changeset
  3761
addToCommandHistory:aCommandString for:aFilename
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3762
    |cmd suffix cmdHist historySize|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3763
321c1729db5b initial checkin
penk
parents:
diff changeset
  3764
    cmdHist := self class commandHistory.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6479
diff changeset
  3765
    (aCommandString notEmptyOrNil) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3766
        cmdHist notNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3767
            cmdHist addFirst:aCommandString.
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3768
            historySize := self class commandHistorySize.
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3769
            (historySize notNil and:[cmdHist size > historySize]) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3770
                cmdHist removeLast
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3771
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3772
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3773
        aFilename notNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3774
            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
  3775
            DefaultCommandPerSuffix isNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3776
                DefaultCommandPerSuffix := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3777
            ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3778
            suffix := aFilename asFilename suffix.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3779
            suffix notNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3780
                DefaultCommandPerSuffix at:suffix put:cmd.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3781
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3782
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3783
    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3784
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3785
321c1729db5b initial checkin
penk
parents:
diff changeset
  3786
doBack
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6284
diff changeset
  3787
    "go backward in the history"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3788
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3789
    | fileName|
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3790
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3791
    fileName := self directoryHistory goBackward.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3792
    fileName notNil ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  3793
        self gotoFile:(fileName asFilename).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3794
    ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3795
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3796
321c1729db5b initial checkin
penk
parents:
diff changeset
  3797
doForward
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6284
diff changeset
  3798
    "go forward in the history"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3799
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  3800
    | fileName|
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  3801
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  3802
    fileName := self directoryHistory goForward.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3803
    fileName notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3804
        self gotoFile:(fileName asFilename).
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3805
    ] ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  3806
        self enableForward value:false.
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3807
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  3808
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3809
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3810
321c1729db5b initial checkin
penk
parents:
diff changeset
  3811
!AbstractFileBrowser methodsFor:'applications'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3812
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3813
applicationNamed:anApplicationName ifPresentDo:aBlock
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3814
    |appl|
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3815
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3816
    appl := self applications at:anApplicationName ifAbsent:nil.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3817
    appl notNil ifTrue:[
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3818
        ^ aBlock value:appl
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3819
    ].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3820
    ^ nil.
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3821
!
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  3822
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  3823
directoryContentsBrowser
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  3824
    ^ self applications at:#DirectoryContentsBrowser ifAbsent:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3825
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  3826
321c1729db5b initial checkin
penk
parents:
diff changeset
  3827
!AbstractFileBrowser methodsFor:'aspects'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3828
321c1729db5b initial checkin
penk
parents:
diff changeset
  3829
applications
321c1729db5b initial checkin
penk
parents:
diff changeset
  3830
    ^ aspects at:#applications
321c1729db5b initial checkin
penk
parents:
diff changeset
  3831
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3832
321c1729db5b initial checkin
penk
parents:
diff changeset
  3833
backgroundProcesses
321c1729db5b initial checkin
penk
parents:
diff changeset
  3834
321c1729db5b initial checkin
penk
parents:
diff changeset
  3835
    ^ self aspectFor:#backgroundProcesses ifAbsent:[List new]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3836
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3837
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  3838
canMake
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3839
    ^ self aspectFor:#canMake ifAbsent:[ ValueHolder with:false ].
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  3840
!
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  3841
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3842
canOpenChangeBrowser
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3843
    ^ self aspectFor:#canOpenChangeBrowser ifAbsent:[ false asValue ].
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3844
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3845
    "Created: / 30-06-2018 / 18:29:53 / Claus Gittinger"
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3846
!
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  3847
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3848
currentDirectories
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3849
    " returns a holder on a Collection of all currently selected directories  
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3850
      if only a file is selected, currentDirectories holds the directory of the file
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3851
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  3852
321c1729db5b initial checkin
penk
parents:
diff changeset
  3853
    ^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3854
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3855
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3856
currentDirectoriesValue
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3857
    " returns a Collection of all currently selected directories  
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3858
      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
  3859
    "
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3860
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3861
    ^ self currentDirectories value
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3862
!
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3863
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3864
currentDirectory
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3865
    "return the single current directory or nil"
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3866
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3867
    |directories|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3868
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  3869
    directories := self currentSelectedDirectories.
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3870
    (directories size ~= 1) ifTrue:[
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3871
        ^ nil
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3872
    ].
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3873
    ^ directories first.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3874
!
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  3875
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3876
currentDirectoryDisplayed
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3877
    "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
  3878
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3879
    ^self subclassResponsibility
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3880
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3881
    "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
  3882
!
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  3883
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3884
currentFileNameHolder
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3885
    "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
  3886
     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
  3887
     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
  3888
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3889
    ^ self aspectFor:#currentFileNameHolder 
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3890
        ifAbsent:[
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3891
            |currentSel|    
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  3892
4692
f87e230b4688 Shelter class variable from rubbish.
martin
parents: 4684
diff changeset
  3893
            currentSel := self class currentSelection.
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3894
            currentSel isEmpty ifTrue:[
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3895
                currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3896
            ].
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3897
            currentSel asValue
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3898
        ] 
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3899
        notPresentDo:[:holder|
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3900
            |filenames newFilenames|
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3901
            filenames := holder value.
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3902
            newFilenames := Set new.
6589
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3903
            filenames do:[:eachFilename|  
fd0a284321cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6586
diff changeset
  3904
                |existingFilename|
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3905
                existingFilename := eachFilename. 
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3906
                existingFilename notNil ifTrue:[
9649
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3907
                    [existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  3908
                        existingFilename := existingFilename directory.
4955
378481247391 if no item is selected directory up action do nothing now
penk
parents: 4950
diff changeset
  3909
                    ].
9649
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3910
                    existingFilename exists ifTrue:[
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3911
                        newFilenames add:existingFilename.
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3912
                    ].
4955
378481247391 if no item is selected directory up action do nothing now
penk
parents: 4950
diff changeset
  3913
                ]
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3914
            ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3915
            newFilenames asOrderedCollection.
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  3916
        ]
9649
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3917
ad956ada348e changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9607
diff changeset
  3918
    "Modified: / 27-11-2010 / 15:42:45 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3919
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3920
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3921
defaultFileEncoding
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3922
    ^ #'iso8859-1' "/ #'utf-8'
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3923
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3924
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3925
enableDirectoryUp
321c1729db5b initial checkin
penk
parents:
diff changeset
  3926
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3927
    ^ self aspectFor:#enableDirectoryUp ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3928
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3929
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3930
enableGotoDefaultDirectory
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3931
    ^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ ValueHolder with:true ].
4593
a2b057480bfc added gotoDefault button
Claus Gittinger <cg@exept.de>
parents: 4585
diff changeset
  3932
!
a2b057480bfc added gotoDefault button
Claus Gittinger <cg@exept.de>
parents: 4585
diff changeset
  3933
8168
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  3934
enableGotoDesktop
14308
192c81c86815 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14298
diff changeset
  3935
    "/ backward compatibility
192c81c86815 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14298
diff changeset
  3936
    ^ self enableGotoDesktopDirectory.
8168
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  3937
!
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  3938
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3939
enableGotoDesktopDirectory
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  3940
    ^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ ValueHolder with:true ].
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3941
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3942
    "Created: / 01-10-2010 / 16:19:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3943
!
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  3944
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  3945
enableGotoDocumentsDirectory
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  3946
    ^ self aspectFor:#enableGotoDocumentsDirectory ifAbsent:[ ValueHolder with:true ].
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  3947
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  3948
    "Created: / 01-10-2010 / 16:19:17 / cg"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  3949
!
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  3950
18352
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  3951
enableGotoDownloadsDirectory
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  3952
    ^ self aspectFor:#enableGotoDownloadsDirectory ifAbsent:[ ValueHolder with:true ].
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  3953
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  3954
    "Created: / 01-10-2010 / 16:19:17 / cg"
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  3955
!
ee486b3355c7 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18274
diff changeset
  3956
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  3957
enableGotoSmalltalkDirectory
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  3958
    ^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ].
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  3959
!
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  3960
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3961
enableGotoSmalltalkWorkspaceDirectory
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3962
    ^ self aspectFor:#enableGotoSmalltalkWorkspaceDirectory ifAbsent:[ true asValue ].
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3963
!
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  3964
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3965
enableGotoTempDirectory
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3966
    ^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ].
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3967
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3968
    "Created: / 29-12-2010 / 11:01:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3969
!
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  3970
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3971
enableHome
321c1729db5b initial checkin
penk
parents:
diff changeset
  3972
321c1729db5b initial checkin
penk
parents:
diff changeset
  3973
    ^ self aspectFor:#enableHome ifAbsent:[ true asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  3974
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3975
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3976
enableMakeCurrentDirectory
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3977
    ^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ].
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3978
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3979
    "Created: / 26-10-2010 / 17:17:58 / cg"
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3980
!
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  3981
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  3982
enableViewNoteBookApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  3983
321c1729db5b initial checkin
penk
parents:
diff changeset
  3984
    ^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue]
321c1729db5b initial checkin
penk
parents:
diff changeset
  3985
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  3986
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3987
fileEncoding
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3988
    ^ self fileEncodingHolder value
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3989
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3990
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  3991
fileEncoding:newEncoding
5533
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3992
    self fileEncodingHolder value:newEncoding.
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3993
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3994
    self 
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3995
        applicationNamed:#FileApplicationNoteBook
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3996
        ifPresentDo:[:nb | 
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3997
            |appl|
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3998
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  3999
            appl := nb selectedApplication.
5535
f19a31cf305d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
  4000
            (appl notNil and:[appl isTextEditor]) ifTrue:[
5533
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4001
                appl fileEncoding:newEncoding
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4002
            ]
263ed8c55a1d encoding stuff
Claus Gittinger <cg@exept.de>
parents: 5528
diff changeset
  4003
        ].
5528
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  4004
!
54e3fbee2822 fileEncoding
Claus Gittinger <cg@exept.de>
parents: 5491
diff changeset
  4005
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4006
fileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4007
    ^ self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4008
        aspectFor:#fileEncodingHolder 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4009
        ifAbsent:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4010
            self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4011
                applicationNamed:#FileApplicationNoteBook
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4012
                ifPresentDo:[:appl | appl fileEncodingHolder].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4013
        ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4014
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4015
17485
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  4016
fileEntryFieldHolder
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  4017
    ^ self subclassResponsibility.
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  4018
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  4019
    "Created: / 31-03-2017 / 11:36:49 / stefan"
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  4020
!
03eb18e3a5f6 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 17481
diff changeset
  4021
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4022
firstSelectedFileName
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4023
    |files|
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4024
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4025
    files := self currentSelectedObjects.
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4026
    files notEmpty ifTrue:[
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4027
        ^ files first
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4028
    ].
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4029
    ^ nil
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4030
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4031
    "Modified: / 04-12-2006 / 13:14:53 / cg"
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4032
!
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  4033
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  4034
gotoDefaultDirectoryIsVisible
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4035
    ^ true.
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4036
"/    ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename).
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4037
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4038
    "Modified: / 26-10-2010 / 17:23:51 / cg"
6456
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  4039
!
c4d6e69319bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6454
diff changeset
  4040
9572
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4041
gotoDesktopDirectoryIsVisible
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4042
    Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false].
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4043
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4044
    ^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename).
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4045
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4046
    "Created: / 01-10-2010 / 16:26:27 / cg"
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4047
!
Claus Gittinger <cg@exept.de>
parents: 9509
diff changeset
  4048
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  4049
hasFileSelection
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  4050
    ^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ].
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  4051
!
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  4052
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4053
hasNotTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4054
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4055
        aspectFor:#hasNotTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4056
        ifAbsent:[
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4057
            BlockValue 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4058
                with:[:m | self hasTwoDirectoriesSelected not]
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4059
                argument:self currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4060
        ].
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4061
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4062
    "Created: / 20-05-2010 / 10:45:50 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4063
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4064
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4065
hasNotTwoFilesSelectedHolder
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4066
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4067
        aspectFor:#hasNotTwoFilesSelectedHolder
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4068
        ifAbsent:[
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4069
            BlockValue 
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4070
                with:[:m | self hasTwoFilesSelected not]
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4071
                argument:self currentFileNameHolder
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4072
        ].
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4073
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4074
    "Modified: / 20-05-2010 / 10:46:01 / cg"
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4075
!
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4076
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4077
hasSelection
17923
75e9605da9f0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17889
diff changeset
  4078
    "aspect holding true, if a file is selected"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4079
321c1729db5b initial checkin
penk
parents:
diff changeset
  4080
    ^ self aspectFor:#hasSelection ifAbsent:[ false asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4081
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4082
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4083
hasTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4084
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4085
        aspectFor:#hasTwoDirectoriesSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4086
        ifAbsent:[
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4087
            BlockValue 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4088
                with:[:m | self hasTwoDirectoriesSelected]
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4089
                argument:self currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4090
        ].
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4091
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4092
    "Created: / 20-05-2010 / 10:45:41 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4093
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4094
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4095
hasTwoFilesSelectedHolder
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4096
    ^ self 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4097
        aspectFor:#hasTwoFilesSelectedHolder
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4098
        ifAbsent:[
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4099
            BlockValue 
5830
fd5a247d6fb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5828
diff changeset
  4100
                with:[:m | self hasTwoFilesSelected]
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4101
                argument:self currentFileNameHolder
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  4102
        ].
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4103
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  4104
    "Modified: / 20-05-2010 / 10:46:08 / cg"
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4105
!
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4106
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4107
inputTabColumnConversion
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4108
    ^ self inputTabColumnConversionHolder value
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4109
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4110
    "Created: / 06-01-2012 / 15:25:56 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4111
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4112
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4113
inputTabColumnConversionHolder
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4114
    ^ self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4115
        aspectFor:#inputTabColumnConversionHolder 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4116
        ifAbsent:[
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4117
            self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4118
                applicationNamed:#FileApplicationNoteBook
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4119
                ifPresentDo:[:appl | appl inputTabColumnConversionHolder].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4120
        ]
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4121
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4122
    "Created: / 06-01-2012 / 15:26:16 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4123
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4124
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4125
lineEndConvention
15208
c02c92b1c524 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15189
diff changeset
  4126
    ^ self lineEndConventionHolder value asSymbol
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4127
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4128
    "Created: / 06-01-2012 / 13:05:14 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4129
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4130
11591
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4131
lineEndConvention: aSymbol
18525
de9b7b5fc8ba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18511
diff changeset
  4132
    self lineEndConventionHolder value:(aSymbol ifNotNil:[aSymbol asSymbol])
11591
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4133
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4134
    "Created: / 11-07-2012 / 19:51:58 / cg"
18525
de9b7b5fc8ba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18511
diff changeset
  4135
    "Modified: / 13-11-2018 / 11:13:41 / Stefan Vogel"
11591
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4136
!
e29642ba38b9 added: #lineEndConvention:
Claus Gittinger <cg@exept.de>
parents: 11501
diff changeset
  4137
11053
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4138
lineEndConventionHolder
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4139
    ^ self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4140
        aspectFor:#lineEndConventionHolder 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4141
        ifAbsent:[
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4142
            self 
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4143
                applicationNamed:#FileApplicationNoteBook
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4144
                ifPresentDo:[:appl | appl lineEndConventionHolder].
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4145
        ]
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4146
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4147
    "Created: / 06-01-2012 / 13:02:51 / cg"
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4148
!
496110873111 added:12 methods
Claus Gittinger <cg@exept.de>
parents: 11052
diff changeset
  4149
5737
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4150
lockFileEncoding:aBoolean
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4151
    self lockFileEncodingHolder value:aBoolean.
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4152
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4153
    self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4154
        applicationNamed:#FileApplicationNoteBook
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4155
        ifPresentDo:[:nb | 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4156
            |appl|
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4157
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4158
            appl := nb selectedApplication.
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4159
            (appl notNil and:[appl isTextEditor]) ifTrue:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4160
                appl lockFileEncoding:aBoolean
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4161
            ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4162
        ].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4163
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4164
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4165
lockFileEncodingHolder
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4166
    ^ self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4167
        aspectFor:#lockFileEncodingHolder 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4168
        ifAbsent:[
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4169
            self 
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4170
                applicationNamed:#FileApplicationNoteBook
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4171
                ifPresentDo:[:appl | appl lockFileEncodingHolder].
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4172
        ]
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4173
!
c5a659e2c4c7 added lockFileEncoding
Claus Gittinger <cg@exept.de>
parents: 5725
diff changeset
  4174
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4175
makeCommandHolder
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4176
    ^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4177
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4178
    "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
  4179
!
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4180
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4181
notify:aString
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4182
    "aString is shown in the lower pane"
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4183
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4184
    self notifyChannel value:aString
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4185
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  4186
    "Modified (comment): / 11-01-2012 / 21:46:55 / cg"
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4187
!
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4188
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4189
notifyChannel
321c1729db5b initial checkin
penk
parents:
diff changeset
  4190
321c1729db5b initial checkin
penk
parents:
diff changeset
  4191
    ^ self aspectFor:#notifyChannel ifAbsent:['' asValue]
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4192
!
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4193
9575
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4194
progressPercentageHolder
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4195
    ^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ].
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4196
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4197
    "Created: / 11-10-2010 / 12:54:46 / cg"
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4198
!
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  4199
4071
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4200
rootHolder
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4201
    "holder, which keeps the rootHolder of the treeView
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4202
    "
f923c8257818 *** empty log message ***
penk
parents: 4060
diff changeset
  4203
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4204
    ^ self aspectFor:#rootHolder ifAbsent:[
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4205
        self class rootHolder asValue.
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4206
    ].
8192
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4207
!
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4208
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4209
rootHolder:aHolder
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4210
26660fb61e7a Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8185
diff changeset
  4211
    self aspectFor:#rootHolder put:aHolder
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4212
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4213
321c1729db5b initial checkin
penk
parents:
diff changeset
  4214
!AbstractFileBrowser methodsFor:'aspects handling'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4215
321c1729db5b initial checkin
penk
parents:
diff changeset
  4216
aspectFor:something ifAbsent:aBlock
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4217
    "returns the model for an aspect; these are stored in a common dictionary"
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4218
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4219
    ^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4220
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4221
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4222
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4223
    "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
  4224
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4225
    |holder saveAspectItem aspect|
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4226
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4227
    holder := aspects at:aKey ifAbsent:[
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4228
        masterApplication notNil ifTrue:[
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4229
            holder := masterApplication aspectOrNil:aKey forSubApplication:self.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4230
        ].
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4231
        holder isNil ifTrue:[
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4232
            saveAspectItem := self runtimeAspectValueFor:aKey.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4233
            saveAspectItem notNil ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4234
                saveAspectItem isHolder ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4235
                    holder := ValueHolder with:saveAspectItem value 
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4236
                ] ifFalse:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4237
                    holder := saveAspectItem value 
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4238
                ].
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4239
            ] ifFalse:[
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4240
                aspect := self userPreferencesAspectValueFor:aKey.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4241
                aspect notNil ifTrue:[ 
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4242
                    holder := aspect asValue
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4243
                ] ifFalse:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4244
                    holder := aBlock value.
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4245
                ]
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4246
            ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4247
        ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4248
        holder notNil ifTrue:[  
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4249
            notPresentBlock notNil ifTrue:[
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4250
                holder value:(notPresentBlock value:holder).
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4251
            ].
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4252
            aspects at:aKey put:holder
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4253
        ].
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4254
        holder
4213
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4255
    ].
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4256
    ^ holder
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4257
!
b8e7d4276a33 startup if old filename not present - go up to first directory in path
penk
parents: 4203
diff changeset
  4258
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4259
aspectFor:something put:aValueHolder
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4260
    "stores the model for an aspect; these are stored in a common dictionary"
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4261
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4262
    aspects at:something put:aValueHolder
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4263
!
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  4264
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4265
aspects
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4266
    "returns the common aspect dictionary"
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4267
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4268
    ^ aspects
321c1729db5b initial checkin
penk
parents:
diff changeset
  4269
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4270
321c1729db5b initial checkin
penk
parents:
diff changeset
  4271
runtimeAspectValueFor:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  4272
    "returns the default aspect item from the class variable RuntimeAspects
321c1729db5b initial checkin
penk
parents:
diff changeset
  4273
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4274
    ^ self class runtimeAspects at:something ifAbsent:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4275
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4276
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4277
saveAspectValues
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4278
    |prefs saveAspects aspectValue|
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4279
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4280
    prefs := UserPreferences current.
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4281
    
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4282
    saveAspects := self class userPreferencesAspectList keys.
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4283
    saveAspects do:[ :aspectKey |
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4284
        aspectValue := (self perform:aspectKey) value.
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4285
        prefs 
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4286
            at: ('fileBrowser_',aspectKey asString) asSymbol 
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4287
            put: aspectValue.
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4288
    ].
16306
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4289
    prefs beModified.
3e6267eef3aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16188
diff changeset
  4290
    
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4291
    "Modified: / 04-09-2006 / 10:02:41 / cg"
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4292
!
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4293
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4294
saveRuntimeAspectValues
321c1729db5b initial checkin
penk
parents:
diff changeset
  4295
    |savedAspects dictionary value isHolder aspect|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4296
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4297
    savedAspects := self class listOfRuntimeValuesToRemember.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4298
    dictionary := Dictionary new.
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4299
    savedAspects do:[:aspectKey | 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4300
        aspect := self perform:aspectKey.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4301
        isHolder := aspect isValueModel.
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4302
        isHolder ifTrue:[
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4303
            value := aspect value
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4304
        ] ifFalse:[
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4305
            value := aspect
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4306
        ].
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4307
        dictionary at:aspectKey
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4308
            put:(SaveAspectItem withValue:value isHolder:isHolder)
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4309
    ].
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4310
    RuntimeAspects := dictionary.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4311
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4312
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4313
userPreferencesAspectValueFor:something
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4314
    "returns the default aspect from the Userpreferences
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4315
    "
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4316
7078
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4317
    (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
  4318
    ^ UserPreferences current 
47db06f88879 preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
  4319
        at:('fileBrowser_',something) asSymbol
9579
7107f49e4583 changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents: 9575
diff changeset
  4320
        ifAbsent:nil "(self class userPreferencesAspectList at:something)".
7107f49e4583 changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents: 9575
diff changeset
  4321
7107f49e4583 changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents: 9575
diff changeset
  4322
    "Modified: / 14-10-2010 / 19:16:38 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4323
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4324
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4325
!AbstractFileBrowser methodsFor:'aspects-filter'!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4326
9015
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4327
filter:aString
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4328
    self filterModel value:aString
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4329
!
c6ecad0d7fdd added: #filter:
Claus Gittinger <cg@exept.de>
parents: 8994
diff changeset
  4330
4018
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4331
filterBackgroundColor
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4332
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4333
    ^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue]
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4334
!
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4335
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4336
filterBlockHolder
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4337
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4338
    ^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue]
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4339
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4340
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4341
filterListModel
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4342
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4343
    ^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList]
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4344
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4345
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4346
filterModel
5941
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4347
    |m|
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4348
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4349
    m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue].
0191d8b73eb8 do not remember filter
Claus Gittinger <cg@exept.de>
parents: 5936
diff changeset
  4350
    ^ m
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4351
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4352
8185
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4353
filterModel:aHolder
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4354
    self aspectFor:#filterModel put:aHolder.
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4355
!
8b6f11fd7fbf Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents: 8172
diff changeset
  4356
4018
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4357
filterValueBox
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4358
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4359
    ^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new]
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4360
!
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4361
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4362
makeFilterBlock
14497
6d95f7c8d28e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14419
diff changeset
  4363
    "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
  4364
     to be shown"
6beb56becd84 changed: #makeFilterBlock
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  4365
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4366
    | filterString filterStrings filters notFilters showHidden filterBlock caseSensitive|
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4367
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4368
    filterString := self filterModel value.
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4369
    filterString = '' ifTrue:[filterString := '*'].
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4370
    caseSensitive := "ignoreCaseInPattern ?" Filename isCaseSensitive.
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
    filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;.
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4373
    filterStrings := filterStrings
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4374
                select:[:eachFilter | eachFilter withoutSeparators notEmpty].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4375
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4376
    filters := filterStrings
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4377
                reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~']
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4378
                thenCollect:
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4379
                    [:eachPattern |
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4380
                        |pattern|
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4381
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4382
                        pattern := eachPattern withoutSeparators.
15597
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4383
                        pattern includesMatchCharacters ifFalse:[
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4384
                            "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
  4385
                             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
  4386
                            "/ pattern first == $* ifFalse:[pattern := '*' , pattern].
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4387
                            "/ pattern last  == $* ifFalse:[pattern := pattern , '*'].
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4388
                            [:name :baseName | baseName asLowercase includesString:pattern caseSensitive:caseSensitive]
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4389
                        ] ifTrue:[
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4390
                            pattern = '*' ifTrue:[
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4391
                                [:name :baseName | true].
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4392
                            ] ifFalse:[    
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4393
                                [:name :baseName | pattern match:baseName caseSensitive:caseSensitive]
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4394
                            ].
15597
0d047081deb7 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15589
diff changeset
  4395
                        ].
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4396
                    ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4397
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4398
    notFilters := filterStrings
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4399
                select:[:eachFilter | eachFilter withoutSeparators startsWith:'~']
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4400
                thenCollect:
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4401
                    [:eachPattern |
9296
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4402
                        |pattern|
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4403
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4404
                        pattern := eachPattern withoutSeparators.
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4405
                        pattern := (pattern copyFrom:2) withoutSeparators.
17481
a2fe1e2e1727 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17416
diff changeset
  4406
                        [:name :baseName | pattern match:baseName caseSensitive:caseSensitive]
9296
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4407
                    ].
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4408
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4409
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4410
    (filters size == 1 and:[notFilters isEmpty]) ifTrue:[ 
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4411
        filterBlock := filters first 
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4412
    ] ifFalse:[
12760
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4413
        filters isEmpty ifTrue:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4414
            filterBlock := [:name :baseName | 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4415
                               (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4416
                           ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4417
        ] ifFalse:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4418
            notFilters isEmpty ifTrue:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4419
                filterBlock := [:name :baseName | 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4420
                                   (filters contains:[:aFilter | aFilter value:name value:baseName ])
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4421
                               ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4422
            ] ifFalse:[
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4423
                filterBlock := [:name :baseName | 
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4424
                                   (filters contains:[:aFilter | aFilter value:name value:baseName ])
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4425
                                   and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ]
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4426
                               ].
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4427
            ]
4416657efa36 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12707
diff changeset
  4428
        ]
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4429
    ].
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4430
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4431
    showHidden := self showHiddenFiles value.
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4432
    showHidden ifTrue:[
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4433
        ^ filterBlock.
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4434
    ].
9296
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4435
    ^ [:name :baseName | 
98f29a4338b8 changed: #makeFilterBlock
Stefan Vogel <sv@exept.de>
parents: 9268
diff changeset
  4436
                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
  4437
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4438
    "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
  4439
    "Modified: / 27-03-2017 / 12:52:08 / stefan"
17772
52be86700796 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17769
diff changeset
  4440
    "Modified: / 20-11-2017 / 22:02:04 / cg"
4018
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4441
!
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4442
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4443
shownFiles
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4444
43e02c59719d *** empty log message ***
penk
parents: 4011
diff changeset
  4445
    ^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue]
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4446
! !
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4447
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  4448
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4449
!AbstractFileBrowser methodsFor:'aspects-history'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4450
321c1729db5b initial checkin
penk
parents:
diff changeset
  4451
dirHistory
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4452
    "obsolete"
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4453
    ^ self directoryHistory
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4454
!
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4455
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4456
directoryHistory
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  4457
    ^ self class directoryHistory
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4458
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4459
321c1729db5b initial checkin
penk
parents:
diff changeset
  4460
enableBack
321c1729db5b initial checkin
penk
parents:
diff changeset
  4461
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4462
    ^ self aspectFor:#enableBack ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4463
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4464
321c1729db5b initial checkin
penk
parents:
diff changeset
  4465
enableFileHistory
321c1729db5b initial checkin
penk
parents:
diff changeset
  4466
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4467
    ^ self aspectFor:#enableFileHistory ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4468
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4469
321c1729db5b initial checkin
penk
parents:
diff changeset
  4470
enableForward
321c1729db5b initial checkin
penk
parents:
diff changeset
  4471
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4472
    ^ self aspectFor:#enableForward ifAbsent:[ValueHolder with:false]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4473
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4474
321c1729db5b initial checkin
penk
parents:
diff changeset
  4475
fileHistory
9820
07b7d7929e3e variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents: 9793
diff changeset
  4476
    ^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4477
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4478
321c1729db5b initial checkin
penk
parents:
diff changeset
  4479
!AbstractFileBrowser methodsFor:'aspects-visibility'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4480
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4481
activityVisibilityChannel
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  4482
    " activityVisibilityChannel switches the activity indicator on/off"
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4483
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4484
    ^ self aspectFor:#activityVisibilityChannel ifAbsent:[ ValueHolder with:false ].
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4485
!
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  4486
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4487
alwaysUseSmalltalkTools
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4488
    " aspect to prevent os tools to be opened on double click"
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4489
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4490
    ^ self aspectFor:#alwaysUseSmalltalkTools ifAbsent:[ ValueHolder with:true ].
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4491
!
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4492
6602
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4493
changeSetBrowserItemVisible
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4494
    ^ Screen current ctrlDown.
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4495
!
6510a174cddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6593
diff changeset
  4496
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4497
cvsMenusAreShown
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4498
    ^ ConfigurableFeatures includesFeature: #CVSSupportEnabled
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4499
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4500
    "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
  4501
    "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
  4502
!
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4503
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4504
hgMenusAreShown
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4505
     ^ (ConfigurableFeatures includesFeature: #HGSupportEnabled)
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4506
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4507
    "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
  4508
!
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4509
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4510
mercurialMenusAreShown
11147
ce417478b309 changed:
Claus Gittinger <cg@exept.de>
parents: 11144
diff changeset
  4511
    ^ ConfigurableFeatures hasMercurialSupportEnabled
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4512
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4513
    "Created: / 15-01-2012 / 13:00:00 / cg"
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4514
!
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4515
4110
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4516
openAlwaysInTextEditor
18274
78c789c6c2bf #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18264
diff changeset
  4517
    "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
  4518
15111
3c2f1e7dc492 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15108
diff changeset
  4519
    ^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ].
18274
78c789c6c2bf #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18264
diff changeset
  4520
78c789c6c2bf #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18264
diff changeset
  4521
    "Modified (comment): / 19-07-2018 / 15:28:00 / Stefan Vogel"
4110
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4522
!
79f87cb97704 *** empty log message ***
penk
parents: 4107
diff changeset
  4523
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4524
openMultipleApplicationsForType
321c1729db5b initial checkin
penk
parents:
diff changeset
  4525
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4526
    " 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
  4527
      open TextEditor "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4528
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4529
    ^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4530
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4531
11137
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4532
perforceMenusAreShown
11996
e3b824f2d454 changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents: 11995
diff changeset
  4533
    ^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled)
e3b824f2d454 changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents: 11995
diff changeset
  4534
    and:[ ConfigurableFeatures hasPerforceSupportEnabled ]
11137
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4535
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4536
    "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
  4537
    "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
  4538
    "Modified: / 02-11-2012 / 11:19:59 / cg"
11137
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4539
!
Claus Gittinger <cg@exept.de>
parents: 11135
diff changeset
  4540
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
  4541
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
  4542
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
  4543
    ^ 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
  4544
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
  4545
    "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
  4546
!
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
  4547
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4548
showDirectoryTree
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4549
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4550
    ^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4551
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4552
4554
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4553
showDiskUsageHolder
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4554
    |holder|
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4555
4560
0d3db5e27bc0 default for disk usage is false
Claus Gittinger <cg@exept.de>
parents: 4558
diff changeset
  4556
    holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue].
4781
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4557
    holder addDependent:self.
4554
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4558
    ^ holder
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4559
!
467311f7345a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
  4560
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4561
showHiddenFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  4562
9582
9ae5011f5ef7 changed: #showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 9579
diff changeset
  4563
    ^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ].
9ae5011f5ef7 changed: #showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 9579
diff changeset
  4564
9ae5011f5ef7 changed: #showHiddenFiles
Claus Gittinger <cg@exept.de>
parents: 9579
diff changeset
  4565
    "Modified: / 15-10-2010 / 10:28:17 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4566
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4567
9108
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4568
showHiddenFiles:aHolder
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4569
    self aspectFor:#showHiddenFiles put:aHolder.
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4570
!
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4571
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4572
shownFiles:aHolder
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4573
    self aspectFor:#shownFiles put:aHolder.
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4574
!
Claus Gittinger <cg@exept.de>
parents: 9102
diff changeset
  4575
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4576
svnMenusAreShown
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  4577
    ^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4578
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4579
    "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
  4580
    "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
  4581
!
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  4582
9945
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4583
tagsBrowserVisibleHolder
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4584
    masterApplication notNil ifTrue:[
11162
faf8af233ac0 changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 11156
diff changeset
  4585
        ^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false
9945
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4586
    ].
10762
311190be6490 changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 10757
diff changeset
  4587
    ^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ].
9945
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4588
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4589
    "Created: / 27-06-2011 / 16:02:59 / cg"
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4590
!
b32126680c13 added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents: 9820
diff changeset
  4591
10757
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4592
useCodeView2InTools
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4593
    ^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ].
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4594
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4595
    "Created: / 06-10-2011 / 11:45:58 / cg"
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4596
!
5bbe8b995a5f added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents: 10747
diff changeset
  4597
4648
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4598
userContextAvailable
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4599
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4600
    " aspect for show group and user columns in contents view
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4601
      windows provides no user context"
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4602
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4603
    ^ OperatingSystem isMSWINDOWSlike not 
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4604
!
f36ffc19982c changes for windows fileBrowser
penk
parents: 4636
diff changeset
  4605
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4606
viewDescription
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4607
    "aspect for show file description in DirectoryContentsBrowser"
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4608
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4609
    ^ self directoryContentsBrowser viewDescription
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4610
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4611
321c1729db5b initial checkin
penk
parents:
diff changeset
  4612
viewDetails
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4613
    "aspect for show more file properties in DirectoryContentsBrowser 
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4614
    "
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4615
6121
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4616
    |directoryContentsBrowser|
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4617
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4618
    directoryContentsBrowser := self directoryContentsBrowser.
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4619
    directoryContentsBrowser isNil ifTrue:[^ nil].    
667e3c599cde *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6116
diff changeset
  4620
    ^ directoryContentsBrowser viewDetails
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4621
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4622
321c1729db5b initial checkin
penk
parents:
diff changeset
  4623
viewDirectoryDescription
321c1729db5b initial checkin
penk
parents:
diff changeset
  4624
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4625
    " 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
  4626
      on change directory "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4627
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4628
    ^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4629
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4630
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4631
viewDirsInContentsBrowser
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4632
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4633
    ^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ].
9319
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4634
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4635
    "
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4636
     UserPreferences current viewDirsInContentsBrowser
23ae966d9dbf comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents: 9299
diff changeset
  4637
    "
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4638
!
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4639
5870
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4640
viewFilesInContentsBrowser
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4641
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4642
    ^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ].
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4643
!
5ea994015006 *** empty log message ***
penk
parents: 5843
diff changeset
  4644
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4645
viewFilesInDirectoryTree
321c1729db5b initial checkin
penk
parents:
diff changeset
  4646
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4647
    " aspect for view files in tree view (not only directories) "
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  4648
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4649
    ^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4650
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4651
321c1729db5b initial checkin
penk
parents:
diff changeset
  4652
viewGroup
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4653
    " aspect for show group information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4654
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4655
    ^ self directoryContentsBrowser viewGroup
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4656
!
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4657
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4658
viewIcon
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4659
    " aspect for show file-type icon in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4660
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4661
    ^ self directoryContentsBrowser viewIcon
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4662
!
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4663
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4664
viewInodeNumber
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4665
    " aspect for show inode numbers in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4666
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4667
    ^ self directoryContentsBrowser viewInodeNumber
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4668
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4669
321c1729db5b initial checkin
penk
parents:
diff changeset
  4670
viewNoteBookApplicationHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
  4671
321c1729db5b initial checkin
penk
parents:
diff changeset
  4672
    ^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4673
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4674
321c1729db5b initial checkin
penk
parents:
diff changeset
  4675
viewOwner
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4676
    " aspect for show owner information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4677
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4678
    ^ self directoryContentsBrowser viewOwner
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4679
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4680
321c1729db5b initial checkin
penk
parents:
diff changeset
  4681
viewPermissions
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4682
    " aspect for show permission information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4683
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4684
    ^ self directoryContentsBrowser viewPermissions
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4685
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4686
321c1729db5b initial checkin
penk
parents:
diff changeset
  4687
viewPreview
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4688
    " aspect for show image previev in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4689
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4690
    ^ self directoryContentsBrowser viewPreview
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4691
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4692
321c1729db5b initial checkin
penk
parents:
diff changeset
  4693
viewSize
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4694
    " aspect for show size information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4695
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4696
    ^ self directoryContentsBrowser viewSize
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4697
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4698
4974
6cebe0a963e5 viewSizeInBytes
Claus Gittinger <cg@exept.de>
parents: 4973
diff changeset
  4699
viewSizeInBytes
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4700
    " aspect for show size-in-bytes information in DirectoryContentsBrowser "
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4701
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4702
    ^ self directoryContentsBrowser viewSizeInBytes
4974
6cebe0a963e5 viewSizeInBytes
Claus Gittinger <cg@exept.de>
parents: 4973
diff changeset
  4703
!
6cebe0a963e5 viewSizeInBytes
Claus Gittinger <cg@exept.de>
parents: 4973
diff changeset
  4704
5312
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4705
viewSizeInKiloBytes
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4706
    " aspect for show size-in-kilobytes information in DirectoryContentsBrowser "
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4707
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4708
    ^ self directoryContentsBrowser viewSizeInKiloBytes
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4709
!
63b275aa2c69 size in Kb
Claus Gittinger <cg@exept.de>
parents: 5306
diff changeset
  4710
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4711
viewTime
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4712
    " aspect for show time information in DirectoryContentsBrowser"
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4713
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4714
    ^ self directoryContentsBrowser viewTime
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4715
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4716
321c1729db5b initial checkin
penk
parents:
diff changeset
  4717
viewType
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4718
    " aspect for show suffix (type) information in DirectoryContentsBrowser"
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4719
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  4720
    ^ self directoryContentsBrowser viewType
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4721
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4722
321c1729db5b initial checkin
penk
parents:
diff changeset
  4723
!AbstractFileBrowser methodsFor:'background processing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4724
321c1729db5b initial checkin
penk
parents:
diff changeset
  4725
executeCommand:cmd
321c1729db5b initial checkin
penk
parents:
diff changeset
  4726
321c1729db5b initial checkin
penk
parents:
diff changeset
  4727
    self executeCommand:cmd inDirectory:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4728
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4729
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4730
executeCommand:cmd inDirectory:aDirectoryOrNil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4731
    | nameString executionBlock|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4732
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4733
    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
  4734
    nameString := 'Execute: ', cmd.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4735
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4736
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4737
321c1729db5b initial checkin
penk
parents:
diff changeset
  4738
getExecutionBlockForCommand:cmd
321c1729db5b initial checkin
penk
parents:
diff changeset
  4739
321c1729db5b initial checkin
penk
parents:
diff changeset
  4740
    ^ self getExecutionBlockForCommand:cmd inDirectory:nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  4741
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4742
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4743
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4744
    | dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4745
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4746
    dir := directoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4747
    directoryOrNil isNil ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  4748
        dir := self theSingleSelectedDirectoryOrNil.
6671
f76b43f3b0ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6652
diff changeset
  4749
        dir isNil ifTrue:[ 
12493
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  4750
            Dialog warn:(resources string:'Please select a single directory.').
16732
f2b590b8d7f8 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16721
diff changeset
  4751
            AbortOperationRequest raise.
6671
f76b43f3b0ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6652
diff changeset
  4752
            ^ nil
f76b43f3b0ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6652
diff changeset
  4753
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4754
    ].
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4755
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4756
    ^ [:stream| 
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4757
        stream notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4758
            OperatingSystem 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4759
                executeCommand:cmd
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4760
                inputFrom:nil 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4761
                outputTo:stream 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4762
                errorTo:stream 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4763
                inDirectory:dir
16732
f2b590b8d7f8 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16721
diff changeset
  4764
                lineWise:true
16825
b5bc034a38d7 #BUGFIX by sr
sr
parents: 16778
diff changeset
  4765
                showWindow:false
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4766
                onError:[:status| false].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4767
        ]
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4768
      ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4769
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4770
321c1729db5b initial checkin
penk
parents:
diff changeset
  4771
killAllRunningBackgroundProcesses
321c1729db5b initial checkin
penk
parents:
diff changeset
  4772
321c1729db5b initial checkin
penk
parents:
diff changeset
  4773
    self backgroundProcesses do:[ : process |
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4774
        self notify:'kill ', process name.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4775
        process terminate.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4776
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4777
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4778
321c1729db5b initial checkin
penk
parents:
diff changeset
  4779
makeExecutionResultProcessFor:aBlock withName:aString
321c1729db5b initial checkin
penk
parents:
diff changeset
  4780
    | stream process appl nameString|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4781
321c1729db5b initial checkin
penk
parents:
diff changeset
  4782
    appl := self openCommandResultApplication.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4783
    stream := appl resultStream.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4784
    nameString := aString ? 'Execution Result'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4785
    appl changeTabTo:nameString.
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  4786
16102
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4787
    process := 
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4788
        [ 
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4789
            [aBlock value:stream] 
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4790
            ensure:[
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4791
                self backgroundProcesses remove:process ifAbsent:[].
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4792
                appl process value:nil.
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4793
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4794
                "/ close automatically, if there was no output.
4571
35e2bf331bdc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  4795
"/                        appl resultStream contents isEmpty ifTrue:[
35e2bf331bdc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  4796
"/                            appl doClose.
35e2bf331bdc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  4797
"/                        ]
16102
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4798
                stream nextPutLine:'Done.'.
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4799
                self enqueueMessage:#updateCurrentDirectory.
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4800
            ]
712049dd76a8 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16084
diff changeset
  4801
        ] newProcess.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4802
    process priority:(Processor userBackgroundPriority).
321c1729db5b initial checkin
penk
parents:
diff changeset
  4803
    process name:nameString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4804
    self backgroundProcesses add:process.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4805
    appl process value:process.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4806
    process resume.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4807
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4808
321c1729db5b initial checkin
penk
parents:
diff changeset
  4809
!AbstractFileBrowser methodsFor:'change & update'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4810
4915
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4811
currentFileNameHolderChanged
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4812
    "/ self currentFileNameHolderChangedForCommon
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4813
!
be97c8dbd840 category
Claus Gittinger <cg@exept.de>
parents: 4891
diff changeset
  4814
4577
52c443045ead *** empty log message ***
penk
parents: 4571
diff changeset
  4815
currentFileNameHolderChangedForCommon
18389
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4816
    |newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty dir|
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4817
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4818
    selection := self currentSelectedObjects.
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4819
    self class currentSelection:selection.
4734
082a31e3bd9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  4820
13521
18393b16599b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13439
diff changeset
  4821
    selectionNotEmpty := selection notEmptyOrNil.
5476
da16d0662a37 refactoring
penk
parents: 5439
diff changeset
  4822
    self hasSelection value:selectionNotEmpty.
da16d0662a37 refactoring
penk
parents: 5439
diff changeset
  4823
    self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]).
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  4824
    self canOpenChangeBrowser value:(selectionNotEmpty).
4734
082a31e3bd9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  4825
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4826
    newDirectories := self directoriesForFiles:selection.
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  4827
    oldDirectories := self currentSelectedDirectories.
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4828
    oldDirectories ~= newDirectories ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4829
        self currentDirectories value:newDirectories.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4830
        size := newDirectories size.
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  4831
        rootInTreeView := self 
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  4832
                            applicationNamed:#DirectoryTreeBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  4833
                            ifPresentDo:[:appl | appl rootHolder].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  4834
        rootInTreeView := rootInTreeView value.
5437
3556b0348494 directory up not allowed for drive root under windows
penk
parents: 5432
diff changeset
  4835
        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
  4836
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4837
        newDirectories notEmpty ifTrue:[
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  4838
            self directoryHistory addToHistory:(newDirectories first asString).
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  4839
        ].
18389
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4840
        (dir := Filename homeDirectory) notNil ifTrue:[
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4841
            self enableHome value:((newDirectories includes:(dir asAbsoluteFilename))not).
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4842
        ].
14308
192c81c86815 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14298
diff changeset
  4843
        "/ self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not).
18389
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4844
        (dir := Filename defaultDirectory) notNil ifTrue:[
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4845
            self enableGotoDefaultDirectory value:((newDirectories includes:(dir asAbsoluteFilename))not).
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4846
        ].
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4847
        (dir := self smalltalkDirectory) notNil ifTrue:[
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4848
            self enableGotoSmalltalkDirectory value:((newDirectories includes:(dir asAbsoluteFilename))not).
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4849
        ].
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4850
        (dir := Filename desktopDirectory) notNil ifTrue:[
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4851
            self enableGotoDesktopDirectory value:((newDirectories includes:(dir asAbsoluteFilename))not).
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4852
        ].
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4853
        (dir := Filename downloadsDirectory) notNil ifTrue:[
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4854
            self enableGotoDownloadsDirectory value:((newDirectories includes:(dir asAbsoluteFilename))not).
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4855
        ].
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  4856
        (dir := Filename documentsDirectory) notNil ifTrue:[
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  4857
            self enableGotoDocumentsDirectory value:((newDirectories includes:(dir asAbsoluteFilename))not).
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  4858
        ].
18389
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4859
        (dir := self tempDirectory) notNil ifTrue:[
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4860
            self enableGotoTempDirectory value:((newDirectories includes:(dir asAbsoluteFilename))not).
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4861
        ].
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4862
    ].
9599
6ffff091db22 changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents: 9596
diff changeset
  4863
    self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]).
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4864
    self enableMakeCurrentDirectory value:(newDirectories size == 1
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  4865
                                           and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]).
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  4866
    self enableForward value:self canForward.
4734
082a31e3bd9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  4867
    self enableBack    value:self canBackward.
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4868
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4869
    self updateCanMake.
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  4870
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  4871
    "Modified: / 29-12-2010 / 11:01:52 / cg"
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4872
    "Modified: / 17-12-2013 / 08:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18389
028d70eb907a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18352
diff changeset
  4873
    "Modified: / 17-09-2018 / 16:25:36 / Claus Gittinger"
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4874
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4875
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4876
filterModelChanged
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4877
5658
eef91fc147fa filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents: 5644
diff changeset
  4878
    self filterBlockHolder value:(self makeFilterBlock).
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4879
!
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4880
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4881
update:something with:aParameter from:changedObject
321c1729db5b initial checkin
penk
parents:
diff changeset
  4882
321c1729db5b initial checkin
penk
parents:
diff changeset
  4883
    " do here all the things that have to be done for every part of the FileBrowserV2
321c1729db5b initial checkin
penk
parents:
diff changeset
  4884
      and the things that have to be done if it runs standalone "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4885
321c1729db5b initial checkin
penk
parents:
diff changeset
  4886
    changedObject == self currentFileNameHolder ifTrue:[
4577
52c443045ead *** empty log message ***
penk
parents: 4571
diff changeset
  4887
        self currentFileNameHolderChangedForCommon.
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4888
        ^ self
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4889
    ].
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  4890
    changedObject == self sortCaseless ifTrue:[
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4891
        self sortFileListsBy:#baseName withReverse:false.
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4892
        ^ self
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  4893
    ].             
6785
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4894
    changedObject == self sortBlockProperty ifTrue:[
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4895
        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
  4896
        ^ self
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  4897
    ].             
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  4898
    (changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4899
        self filterModelChanged.
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4900
        ^ self
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4901
    ].
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4902
    changedObject == self rootHolder ifTrue:[
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4903
        self class rootHolder:(self rootHolder value).
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  4904
        ^ self
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4905
    ].
4781
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4906
    changedObject == self showDiskUsageHolder ifTrue:[
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  4907
        self notify:nil.
4781
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4908
        ^ self
08aacafe88ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4776
diff changeset
  4909
    ].
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  4910
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4911
    super update:something with:aParameter from:changedObject
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  4912
!
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  4913
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4914
updateCanMake
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4915
    |dir can|
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4916
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4917
    can := false.
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4918
    dir := self currentDirectory.
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4919
    dir notNil ifTrue:[    
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4920
        "/ Check for make
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4921
        can := (dir asFilename construct:'Makefile') exists.
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4922
        can ifFalse:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4923
            can := (dir asFilename construct:'makefile') exists.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4924
        ].
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4925
        OperatingSystem isMSWINDOWSlike ifTrue:[
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4926
            can ifFalse:[
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4927
                can := (self currentDirectory asFilename construct:'bc.mak') exists.
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4928
            ]
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4929
        ].
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4930
        can ifTrue:[ 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4931
            self makeCommandHolder value: 'make'. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4932
            self canMake value: true. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4933
            ^ self 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4934
        ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4935
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4936
        "/Check for Apache ant
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4937
        (OperatingSystem canExecuteCommand: 'ant') ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4938
            can := (dir asFilename construct:'build.xml') exists.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4939
            can ifTrue:[ 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4940
                self makeCommandHolder value: 'ant'. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4941
                self canMake value: true. 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4942
                ^ self 
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4943
            ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4944
        ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4945
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4946
        "/Add more here...
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4947
6095
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4948
    ].
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4949
    self canMake value:can.
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4950
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  4951
    "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
  4952
!
a6f6eb0c7b9d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6094
diff changeset
  4953
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  4954
updateListAfterDelete:colOfFiles
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  4955
    self updateCurrentDirectoryWithReread
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4956
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  4957
321c1729db5b initial checkin
penk
parents:
diff changeset
  4958
!AbstractFileBrowser methodsFor:'clipboard'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4959
321c1729db5b initial checkin
penk
parents:
diff changeset
  4960
canPaste
321c1729db5b initial checkin
penk
parents:
diff changeset
  4961
15259
14297d826b29 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15215
diff changeset
  4962
    ^ self aspectFor:#canPaste ifAbsent:[ ValueHolder with:false ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4963
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4964
321c1729db5b initial checkin
penk
parents:
diff changeset
  4965
clipboard
321c1729db5b initial checkin
penk
parents:
diff changeset
  4966
321c1729db5b initial checkin
penk
parents:
diff changeset
  4967
    ^ self aspectFor:#clipboard ifAbsent:[Clipboard new]
321c1729db5b initial checkin
penk
parents:
diff changeset
  4968
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4969
321c1729db5b initial checkin
penk
parents:
diff changeset
  4970
copyFilesToClipBoard:colOfFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  4971
    self putInClipBoard:colOfFiles as:#copy.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4972
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4973
321c1729db5b initial checkin
penk
parents:
diff changeset
  4974
cutFilesToClipBoard:colOfFiles
321c1729db5b initial checkin
penk
parents:
diff changeset
  4975
    "defete current selected files/directories
321c1729db5b initial checkin
penk
parents:
diff changeset
  4976
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  4977
    self putInClipBoard:colOfFiles as:#cut.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4978
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4979
321c1729db5b initial checkin
penk
parents:
diff changeset
  4980
emptyClipBoard
321c1729db5b initial checkin
penk
parents:
diff changeset
  4981
321c1729db5b initial checkin
penk
parents:
diff changeset
  4982
    self clipboard files:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4983
    self canPaste value:false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4984
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  4985
321c1729db5b initial checkin
penk
parents:
diff changeset
  4986
putInClipBoard:colOfFiles as:aSymbol
321c1729db5b initial checkin
penk
parents:
diff changeset
  4987
    | stream clp|
321c1729db5b initial checkin
penk
parents:
diff changeset
  4988
321c1729db5b initial checkin
penk
parents:
diff changeset
  4989
    colOfFiles isEmpty ifTrue:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  4990
    clp := self clipboard.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4991
    clp files:nil.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4992
    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
  4993
603abfa8cf99 copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents: 5756
diff changeset
  4994
    stream := String writeStream.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  4995
    stream nextPutAll:aSymbol asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4996
    stream nextPutAll:' <'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4997
    stream nextPutAll:colOfFiles first asString.
321c1729db5b initial checkin
penk
parents:
diff changeset
  4998
    colOfFiles size > 1 ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  4999
        stream nextPutAll:' ...'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5000
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5001
    stream nextPutAll:'> to clipboard'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5002
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  5003
    self notify:stream contents.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5004
    clp files:colOfFiles.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5005
    self canPaste value:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5006
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5007
321c1729db5b initial checkin
penk
parents:
diff changeset
  5008
!AbstractFileBrowser methodsFor:'drag & drop'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5009
321c1729db5b initial checkin
penk
parents:
diff changeset
  5010
canDropFiles:dropedObjects for:filename 
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5011
    |filenameDirString filenameDir|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5012
321c1729db5b initial checkin
penk
parents:
diff changeset
  5013
    dropedObjects isEmpty ifTrue:[^ false].
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5014
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5015
    filenameDir := self getDirWithoutFileName:filename.
7491
7fd2af9607de bugfix - check for nil directory
ca
parents: 7408
diff changeset
  5016
    filenameDir isNil ifTrue:[^ false ].
13232
a9d07ac57e19 Use #isWritableDirectory
Stefan Vogel <sv@exept.de>
parents: 13121
diff changeset
  5017
    filenameDir isWritableDirectory ifFalse:[^ false].
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5018
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5019
    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
  5020
7ce6eae41e33 do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
  5021
    dropedObjects do:[:aDropObject | 
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5022
        (self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false].
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5023
"/        |dropFileName dropFileNameString physicalPathName|
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5024
"/
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5025
"/        dropFileName := aDropObject theObject.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5026
"/        dropFileNameString := dropFileName asString.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5027
"/        dropFileName isDirectory ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5028
"/            (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5029
"/                self notify:'Cannot drop a directory into one of its parent directories'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5030
"/                ^ false
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5031
"/            ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5032
"/        ] ifFalse:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5033
"/            physicalPathName := dropFileName physicalPathName.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5034
"/            (filenameDirString = dropFileName directory asString 
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5035
"/            or:[ aDropObject isFileInArchive not and:[physicalPathName notNil
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5036
"/                 and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5037
"/                self notify:'Cannot drop a file into same directory'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5038
"/                ^ false
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5039
"/            ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5040
"/        ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5041
    ].
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5042
    self notify:nil.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5043
    ^ true
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5044
!
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5045
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5046
canDropObject:aDropObject into:aDirectory
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5047
    |filenameDirString dropFileName dropFileNameString physicalPathName|
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5048
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5049
    dropFileName := aDropObject theObject.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5050
    dropFileNameString := dropFileName asString.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5051
    dropFileName isDirectory ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5052
        filenameDirString := aDirectory asString.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5053
        (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5054
            self notify:'Cannot drop a directory into one of its parent directories'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5055
            ^ false
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5056
        ]
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5057
    ] ifFalse:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5058
        physicalPathName := dropFileName physicalPathName.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5059
        (aDirectory = dropFileName directory 
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5060
        or:[ aDropObject isFileInArchive not 
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5061
             and:[physicalPathName notNil
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5062
             and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5063
            self notify:'Cannot drop a file into same directory'.
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5064
            ^ false
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5065
        ]
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5066
    ].
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  5067
    ^ true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5068
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5069
7406
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  5070
canDropObjects:aCollectionOfDropObjects in:aWidget
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  5071
    ^ aCollectionOfDropObjects contains:#isFileObject
7406
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  5072
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  5073
    "Created: / 13-10-2006 / 15:52:49 / cg"
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  5074
!
a749af299d5d drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7330
diff changeset
  5075
17202
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
  5076
doStartDrag:arg1 in:arg2
82155dcadf24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17187
diff changeset
  5077
    ^ self class doStartDrag:arg1 in:arg2
6479
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5078
!
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5079
7408
028111416d25 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7406
diff changeset
  5080
dropObjects:aCollectionOfDropObjects in:aWidget at:position
7990
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5081
    |fileEntryFieldHolder destDir dropObject fn d|
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5082
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5083
    fileEntryFieldHolder := self masterApplication notNil 
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5084
                              ifTrue:[ self masterApplication fileEntryFieldHolder ]
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5085
                              ifFalse:[ self fileEntryFieldHolder ].
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5086
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5087
    aWidget model == fileEntryFieldHolder ifTrue:[
7900
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5088
        dropObject := aCollectionOfDropObjects first.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5089
        dropObject isFileObject ifTrue:[
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5090
            fn := dropObject theObject asFilename.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5091
            dropObject isDirectory ifTrue:[
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5092
                d := fn.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5093
            ] ifFalse:[
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5094
                d := fn directory.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5095
            ].
7990
7bfe0f1a8b3d fixed external file drop
Claus Gittinger <cg@exept.de>
parents: 7938
diff changeset
  5096
            fileEntryFieldHolder value:d pathName.
7900
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5097
        ].
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5098
        ^ self.
52ad708471ad drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents: 7897
diff changeset
  5099
    ].
6479
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5100
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5101
    destDir := self currentDirectory.
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5102
    destDir isNil ifTrue:[^ self].
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5103
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5104
    self withWaitCursorDo:[
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5105
        aCollectionOfDropObjects do:[:dropObject |
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5106
            |fn|
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5107
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5108
            dropObject isFileObject ifTrue:[
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5109
                fn := dropObject theObject asFilename.
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5110
                dropObject isDirectory ifTrue:[
8808
cb6476c0cd3a oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents: 8716
diff changeset
  5111
                    fn recursiveCopyTo:destDir
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5112
                ] ifFalse:[
8950
48c69259d82d changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 8887
diff changeset
  5113
                    fn copyTo:(destDir / fn baseName )
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5114
                ]
6479
760c0b357cb1 file drop for win32
Claus Gittinger <cg@exept.de>
parents: 6460
diff changeset
  5115
            ]
8601
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5116
        ].
85c62034c1ff busy cursor in drop
Claus Gittinger <cg@exept.de>
parents: 8590
diff changeset
  5117
    ].
9268
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5118
    self directoryContentsBrowser notNil ifTrue:[
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5119
        self directoryContentsBrowser 
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5120
            directoryContentsChangeFlag:true;
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5121
            wakeUp
fbeb680106c9 changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents: 9267
diff changeset
  5122
    ].
7408
028111416d25 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7406
diff changeset
  5123
028111416d25 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 7406
diff changeset
  5124
    "Created: / 13-10-2006 / 18:26:41 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5125
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5126
321c1729db5b initial checkin
penk
parents:
diff changeset
  5127
!AbstractFileBrowser methodsFor:'file operations'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5128
321c1729db5b initial checkin
penk
parents:
diff changeset
  5129
copyFile:aSourceFile to:aDestFile
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5130
    "copy to"
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5131
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5132
    ^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5133
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5134
    "Modified: / 07-02-2007 / 18:46:44 / cg"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5135
!
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5136
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5137
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5138
    "copy to"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5139
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5140
    |copyOperation msg|
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5141
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5142
    repairCorruptedFiles ifTrue:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5143
        copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5144
    ] ifFalse:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5145
        copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5146
    ].
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5147
    copyOperation result ifTrue:[
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5148
        msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5149
    ] ifFalse:[
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5150
        msg := copyOperation errorString.
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5151
    ].
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  5152
    self notify:msg.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5153
    ^ copyOperation result
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5154
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5155
    "Created: / 07-02-2007 / 18:46:34 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5156
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5157
321c1729db5b initial checkin
penk
parents:
diff changeset
  5158
copyFiles:aColOfSourceFiles to:aDirectory 
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5159
    |copy result|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5160
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5161
    self withActivityIndicationDo:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5162
        copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory.
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5163
        copy result ifTrue:[
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5164
            result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles).
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5165
        ] ifFalse:[
4629
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5166
            self notify:copy errorString.
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5167
        ].
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5168
        self updateCurrentDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5169
    ].
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5170
    ^ result
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5171
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5172
    "Modified: / 25-07-2006 / 09:07:04 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5173
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5174
15569
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5175
copyFromToRepairingCorruptedFiles
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5176
    "ask for source and destination and copy the entered file.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5177
     Especially useful for raw devices to copy corrupted disks/files
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5178
    "
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5179
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5180
    |source destination|
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5181
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5182
    source := Dialog 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5183
                    requestDirectoryName:(resources string:'Copy from:') 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5184
                    default:(LastMoveDestination ? self currentDirectory)
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5185
                    ok:(resources string:'Continue')
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5186
                    abort:nil.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5187
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5188
    source isEmptyOrNil ifTrue:[^ self].
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5189
    source := source asFilename.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5190
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5191
    destination := Dialog 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5192
                    requestDirectoryName:(resources string:'Copy "%1" to:' with:source) 
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5193
                    default:(LastMoveDestination ? self currentDirectory)
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5194
                    ok:(resources string:'Copy')
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5195
                    abort:nil.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5196
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5197
    destination isEmptyOrNil ifTrue:[^ self].
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5198
    destination := destination asFilename.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5199
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5200
    self copyFile:source to:destination repairCorruptedFiles:true.
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5201
!
89c530367f30 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15528
diff changeset
  5202
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5203
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory
12850
baaea91f1adc Fix stc compiler warnings
Stefan Vogel <sv@exept.de>
parents: 12824
diff changeset
  5204
    |size msg answer file|
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5205
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5206
    size := aCollectionOfFiles size.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5207
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5208
"/    stream := WriteStream on:'' asText.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5209
"/    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
  5210
"/    size == 1 ifFalse:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5211
"/        stream nextPutAll:'s'.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5212
"/    ].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5213
"/    stream nextPutAll:': '.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5214
"/    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
  5215
"/    size == 1 ifFalse:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5216
"/        stream nextPutAll:' ... '.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5217
"/        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
  5218
"/    ].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5219
"/    stream cr; nextPutAll:'to: '.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5220
"/    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
  5221
"/    msg := stream contents
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5222
    size == 1 ifTrue:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5223
        file := aCollectionOfFiles first.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5224
        msg := resources    
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5225
                stringWithCRs:'Copy or move\\%1:\    %2\to:\    %3 ?'
17762
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5226
                with:(resources string:
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5227
                        (file type == #regular 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5228
                            ifTrue:'file' 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5229
                            ifFalse:[
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5230
                                file isDirectory 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5231
                                    ifTrue:'directory' 
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5232
                                    ifFalse:'object']))
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5233
                with:(file baseName allBold)
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5234
                with:(aDestinationDirectory asFilename pathName allBold).
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5235
    ] ifFalse:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5236
        msg := resources    
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5237
                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
  5238
                with:size
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5239
                with:(aDestinationDirectory asFilename pathName allBold).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5240
    ].
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5241
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5242
    answer := OptionBox 
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5243
                  request:msg 
8127
116f25bc97ad national strings
Claus Gittinger <cg@exept.de>
parents: 8093
diff changeset
  5244
                  label:(resources string:'Copy or Move')
5898
f6214812e1d2 dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents: 5888
diff changeset
  5245
                  image:(WarningBox iconBitmap)
8127
116f25bc97ad national strings
Claus Gittinger <cg@exept.de>
parents: 8093
diff changeset
  5246
                  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
  5247
                  values:#(#cancel #move #copy #copyAs)
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5248
                  default:#copy.
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5249
    answer isNil ifTrue:[answer := #cancel].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5250
    ^ answer.
17762
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5251
29cf50354a7a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17753
diff changeset
  5252
    "Modified: / 17-11-2017 / 13:16:42 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5253
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5254
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5255
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory 
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5256
    "copy or move aColOfSourceFiles to aDirectory.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5257
     Asks the used if a move or a copy is wanted.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5258
     Returns true if the copyOrMove happened, false if user aborted the operation."
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5259
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5260
    |answer lastOld lastNew|
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5261
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5262
    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
  5263
    answer == #copyAs ifTrue:[
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5264
        aColOfSourceFiles do:[:eachSourceFile |
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5265
            |initial destFile srcBase dstBase|
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5266
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5267
            srcBase := eachSourceFile asFilename baseName.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5268
            lastOld isNil ifTrue:[
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5269
                initial := srcBase
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5270
            ] ifFalse:[
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5271
                initial := DoWhatIMeanSupport
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5272
                            goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5273
            ].
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5274
            dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial.
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5275
            dstBase isNil ifTrue:[^ false].
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5276
            self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase).
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5277
            lastOld := srcBase.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5278
            lastNew := dstBase.
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5279
        ].
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5280
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5281
        ^ true.
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5282
    ].
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5283
    answer == #copy ifTrue:[
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5284
        self copyFiles:aColOfSourceFiles to:aDestinationDirectory.
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5285
        ^ true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5286
    ].
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  5287
    answer == #move ifTrue:[
4354
0a1239cd339d added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  5288
        self moveFiles:aColOfSourceFiles to:aDestinationDirectory.
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5289
        ^ true.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5290
    ].
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
  5291
    ^ false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5292
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5293
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5294
copySelectionTo
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5295
    "copy the selected file(s) to another directory"
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5296
13704
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5297
    self copySelectionToRepairingCorruptedFiles:false.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5298
    self updateCurrentDirectoryWithReread.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5299
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5300
    "Modified: / 07-02-2007 / 18:42:48 / cg"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5301
!
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5302
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5303
copySelectionToRepairingCorruptedFiles
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5304
    "copy the selected file(s) to another directory"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5305
13704
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5306
    self copySelectionToRepairingCorruptedFiles:true.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5307
    self updateCurrentDirectoryWithReread.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5308
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5309
    "Created: / 07-02-2007 / 18:42:59 / cg"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5310
!
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5311
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5312
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5313
    "copy the selected file(s) to another directory"
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5314
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5315
    |selectedFiles msg destination directory|
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5316
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5317
    selectedFiles := self currentSelectedObjects copy.
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5318
    selectedFiles isEmptyOrNil ifTrue:[^ self].
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5319
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5320
    msg := (selectedFiles size > 1) 
14588
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5321
                ifTrue:[ 'Copy Selected Items to Directory:' ]
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5322
                ifFalse:[ 'Copy "%1" to Directory:' ].
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5323
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5324
    destination := Dialog 
14588
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5325
                    requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first baseName) 
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5326
                    default:(LastMoveDestination ? self currentDirectory)
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5327
                    ok:(resources string:'Copy')
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5328
                    abort:nil.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5329
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5330
    destination isEmptyOrNil ifTrue:[^ self].
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5331
    destination := destination asFilename.
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5332
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5333
    destination isDirectory ifFalse:[
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5334
        selectedFiles size == 1 ifTrue:[
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5335
            directory := destination directory.
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5336
            directory isDirectory ifTrue:[
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5337
                LastMoveDestination := directory.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5338
                self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles.
6299
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5339
                ^ self.
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5340
            ]
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5341
        ]
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5342
    ].
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5343
2dcebd9e4bff copy single file to
Claus Gittinger <cg@exept.de>
parents: 6292
diff changeset
  5344
    LastMoveDestination := destination.
7635
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5345
    repairingCorruptedFiles ifTrue:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5346
        selectedFiles do:[:eachFile |    
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5347
            self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5348
        ].
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5349
        ^ self.
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5350
    ] ifFalse:[
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5351
        self copyFiles:selectedFiles to:destination
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5352
    ]
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5353
621ef7c664a7 +copyCorrupt
Claus Gittinger <cg@exept.de>
parents: 7633
diff changeset
  5354
    "Created: / 07-02-2007 / 18:42:35 / cg"
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5355
!
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5356
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5357
deleteFile:aFile
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5358
    "delete the selected files/directories"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5359
321c1729db5b initial checkin
penk
parents:
diff changeset
  5360
    ^ self deleteFiles:(OrderedCollection with:aFile).
321c1729db5b initial checkin
penk
parents:
diff changeset
  5361
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5362
321c1729db5b initial checkin
penk
parents:
diff changeset
  5363
deleteFiles:colOfFiles
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5364
    "delete some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5365
5081
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5366
    ^ self deleteFiles:colOfFiles confirm:true.
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5367
!
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5368
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5369
deleteFiles:colOfFiles confirm:confirm
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5370
    "delete some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5371
5673
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5372
    |delete result|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5373
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5374
    self withActivityIndicationDo:[
9575
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5375
        ProgressNotification handle:[:info |
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5376
            self progressPercentageHolder value:info progressValue.
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5377
            info proceed
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5378
        ] do:[
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5379
            delete := FileOperation deleteFiles:colOfFiles confirm:confirm.
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5380
            result := delete result.
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5381
        ].
5673
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5382
        result notNil ifTrue:[
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5383
            result ifFalse:[
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5384
                self notify:delete errorString.
5753
e5229b5882b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
  5385
            ] ifTrue:[
e5229b5882b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
  5386
                self updateListAfterDelete:colOfFiles.
e5229b5882b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5739
diff changeset
  5387
            ]
4394
a7fedd485b73 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
  5388
        ].
5673
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5389
    ].
3ed1092a3c73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5667
diff changeset
  5390
    ^ result.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5391
9575
548adf8e9d98 added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents: 9572
diff changeset
  5392
    "Modified: / 11-10-2010 / 13:08:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5393
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5394
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5395
eraseFiles:colOfFiles
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5396
    "erase (clear and delete) some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5397
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5398
    ^ self eraseFiles:colOfFiles confirm:true.
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5399
!
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5400
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5401
eraseFiles:colOfFiles confirm:confirm
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5402
    "erase (clear and delete) some files/directories"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5403
8462
a5d12742a900 changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents: 8454
diff changeset
  5404
    |deleteOperation result fileSize|
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5405
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5406
    self withActivityIndicationDo:[
8462
a5d12742a900 changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents: 8454
diff changeset
  5407
        fileSize := colOfFiles first asFilename fileSize.
8294
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5408
        deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm.
8462
a5d12742a900 changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents: 8454
diff changeset
  5409
        (colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ])
8294
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5410
        ifTrue:[
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5411
            result := deleteOperation result.
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5412
        ] ifFalse:[
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5413
            ProgressIndicator
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5414
                displayProgressNotifications:'Erasing' 
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5415
                abortable:true 
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5416
                at:nil 
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5417
                during:[
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5418
                    result := deleteOperation result.
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5419
                ].
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5420
        ].
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5421
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5422
        result notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5423
            result ifFalse:[
8294
22f650a23f59 show progress during erase
Claus Gittinger <cg@exept.de>
parents: 8287
diff changeset
  5424
                self notify:deleteOperation errorString.
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5425
            ] ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5426
                self updateListAfterDelete:colOfFiles.
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5427
            ]
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5428
        ].
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5429
    ].
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5430
    ^ result.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5431
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5432
    "Modified: / 25-07-2006 / 09:07:16 / cg"
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5433
!
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  5434
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5435
moveFile:aSourceFile to:aDestFile
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5436
    "move a file/directory"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5437
321c1729db5b initial checkin
penk
parents:
diff changeset
  5438
    |move|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5439
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5440
    move := FileOperation moveFile:aSourceFile to:aDestFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5441
    move result ifTrue:[
15346
1220ca6a9666 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15259
diff changeset
  5442
        self notify:(resources string: 'move "%1" to "%2"' with:aSourceFile asString with:aDestFile asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5443
    ] ifFalse:[
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  5444
        self notify:move errorString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5445
    ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5446
    self updateCurrentDirectoryWithReread.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5447
    ^ move result
321c1729db5b initial checkin
penk
parents:
diff changeset
  5448
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5449
321c1729db5b initial checkin
penk
parents:
diff changeset
  5450
moveFiles:aColOfSourceFiles to:aDirectory 
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5451
   "move some files to aDirectory"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5452
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5453
    |move|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5454
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5455
    self withActivityIndicationDo:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5456
        move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory.
4629
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5457
        move result ifFalse:[
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5458
            self notify:move errorString.
e8739857466c show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents: 4624
diff changeset
  5459
        ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5460
        self updateCurrentDirectoryWithReread.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5461
    ].
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5462
    ^ move collectionOfMovedFiles
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5463
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  5464
    "Modified: / 25-07-2006 / 09:07:32 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5465
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5466
6107
745d91a22e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6102
diff changeset
  5467
moveSelectionTo
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5468
    "move the selected file(s) to another directory"
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5469
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5470
    |destinationDirectory|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5471
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5472
    destinationDirectory := Dialog 
14588
194e14b18769 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14577
diff changeset
  5473
                                requestDirectoryName:(resources stringWithCRs:'Move Selected Items to Directory:') 
5789
b357cb31cc87 move fix
Claus Gittinger <cg@exept.de>
parents: 5778
diff changeset
  5474
                                default:(LastMoveDestination ? self currentDirectory)
6952
f9bef0205d36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6919
diff changeset
  5475
                                ok:(resources string:'Move')
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5476
                                abort:nil.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5477
    destinationDirectory isEmptyOrNil ifTrue:[^ self].
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5478
5789
b357cb31cc87 move fix
Claus Gittinger <cg@exept.de>
parents: 5778
diff changeset
  5479
    LastMoveDestination := destinationDirectory.
13704
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5480
    self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5481
    self updateCurrentDirectoryWithReread.
38fe95ecc120 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13683
diff changeset
  5482
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5483
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5484
    "Modified: / 04-12-2006 / 13:15:12 / cg"
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5485
!
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5486
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5487
newDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  5488
    "ask for and create a new directory"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5489
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5490
    |selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5491
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5492
    directory := self currentDirectory.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5493
    directory isNil ifTrue:[
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5494
        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
  5495
        ^ self
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5496
    ].
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5497
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5498
    "/ 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
  5499
    selectedFiles := self currentSelectedFiles.
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5500
    selectedFiles size == 1 ifTrue:[
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5501
        singleSelectedFile := selectedFiles first.
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5502
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5503
        mime := MIMETypes mimeTypeForFilename:singleSelectedFile.
13714
d5583c9b5ddb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13704
diff changeset
  5504
        (mime notNil and:[mime isArchiveType]) ifTrue:[
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5505
            defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName.
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5506
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5507
            mime := MIMETypes mimeTypeForFilename:defaultAnswer.
13714
d5583c9b5ddb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13704
diff changeset
  5508
            (mime notNil and:[mime isArchiveType]) ifTrue:[
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5509
                defaultAnswer := defaultAnswer asFilename withoutSuffix baseName
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5510
            ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5511
        ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5512
    ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5513
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5514
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5515
    defaultAnswer notNil ifTrue:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5516
        createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer.
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5517
    ] ifFalse:[
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5518
        createOp := FileOperation createDirectoryIn:directory.
4521
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5519
    ].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5520
    createOp result ifFalse:[ ^ self].
b70a9f623bb1 default in newDir
Claus Gittinger <cg@exept.de>
parents: 4516
diff changeset
  5521
    newFile := createOp createdFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5522
    newFile notNil ifTrue:[
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5523
        self updateCurrentDirectoryWithReread.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5524
    ]
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5525
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5526
    "Modified: / 29-11-2017 / 12:26:41 / cg"
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5527
    "Modified: / 01-06-2018 / 12:49:43 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5528
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5529
321c1729db5b initial checkin
penk
parents:
diff changeset
  5530
newFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  5531
    "ask for and create a new file"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5532
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5533
    | curFile directory create file|
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5534
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5535
    directory := self currentDirectory.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5536
    directory isNil ifTrue:[
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5537
        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
  5538
        ^ self.
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5539
    ].
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5540
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  5541
    curFile := self firstSelectedFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5542
    curFile notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5543
        file := curFile.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5544
    ] ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5545
        file := directory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5546
    ].
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5547
    create := FileOperation createFileIn:file.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5548
    create result ifFalse:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5549
    self updateAndSelect:(OrderedCollection with:(create createdFile)).
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5550
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5551
    "Modified: / 29-11-2017 / 12:26:51 / cg"
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5552
    "Modified: / 01-06-2018 / 12:49:50 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5553
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5554
321c1729db5b initial checkin
penk
parents:
diff changeset
  5555
newHardLink
321c1729db5b initial checkin
penk
parents:
diff changeset
  5556
    "ask for and create a hard link (unix only)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5557
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5558
    self newLink:#hard.
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5559
!
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5560
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5561
newLink:typeOfLink
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5562
    "ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5563
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5564
    | sel dir create createdFile|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5565
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5566
    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
  5567
    (sel size ~= 1) ifTrue:[
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5568
        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
  5569
        ^ self
366465d1a8a5 warn on create new file or directory if nothing selected or more than one directory
penk
parents: 4976
diff changeset
  5570
    ].
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5571
    dir := sel first.
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  5572
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5573
    create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5574
    create result ifFalse:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5575
    createdFile := create createdFile.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5576
    createdFile notNil ifTrue:[
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5577
        typeOfLink == #soft ifTrue:[
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  5578
            self updateCurrentDirectoryWithReread.
4785
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  5579
        ] ifFalse:[
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  5580
            self updateAndSelect:(OrderedCollection with:createdFile).
5a3f7a0c3ff1 symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents: 4782
diff changeset
  5581
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5582
    ].
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5583
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  5584
    "Modified: / 29-11-2017 / 12:26:58 / cg"
18175
403729a65fe5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18036
diff changeset
  5585
    "Modified: / 01-06-2018 / 12:49:32 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5586
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5587
321c1729db5b initial checkin
penk
parents:
diff changeset
  5588
newSoftLink
321c1729db5b initial checkin
penk
parents:
diff changeset
  5589
    "ask for and create a soft link (unix only)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5590
6151
baba7a7d54b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6146
diff changeset
  5591
    self newLink:#soft.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5592
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5593
321c1729db5b initial checkin
penk
parents:
diff changeset
  5594
pasteFiles
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5595
    "paste from clipBoard"
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5596
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5597
    |buffer destination files directories copiedFiles thisIsAFileMoveOperation|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5598
321c1729db5b initial checkin
penk
parents:
diff changeset
  5599
    files := self clipboard files.
6482
00207f456339 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 6479
diff changeset
  5600
    files isEmptyOrNil ifTrue:[ ^ self ].
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5601
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5602
    thisIsAFileMoveOperation := self clipboard method == #cut.
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5603
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5604
    buffer := self clipboard copy.
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  5605
    directories := self currentSelectedDirectories.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5606
    directories size ~~ 1 ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5607
        |box dirStringCol|
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5608
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5609
        dirStringCol := directories collect:[:aDir| aDir asString].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5610
        box := ListSelectionBox new.
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5611
        box title:'Paste into which directory ?'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5612
        box list:dirStringCol.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  5613
        box okAction:[:sel | destination := sel asFilename].
5003
a14ce263ada5 boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents: 4982
diff changeset
  5614
        box show.
a14ce263ada5 boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents: 4982
diff changeset
  5615
        box destroy.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5616
    ] ifFalse:[
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5617
        destination := directories anElement.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5618
    ].
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5619
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5620
    thisIsAFileMoveOperation ifTrue:[
5081
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5621
        buffer files copy do:[:aFile|
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5622
            aFile directory = destination ifTrue:[
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5623
                buffer files remove:aFile.
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5624
            ].
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5625
        ].
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5626
    ].
e55e62d8aeb9 cut and paste files in same directory
penk
parents: 5074
diff changeset
  5627
    copiedFiles := self copyFiles:(buffer files) to:destination.
6374
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5628
    copiedFiles notEmptyOrNil ifTrue:[    
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5629
        thisIsAFileMoveOperation ifTrue:[
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5630
            self deleteFiles:(copiedFiles keys) confirm:false.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5631
        ]. 
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5632
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5633
        "/ select those pasted files.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5634
        self updateCurrentDirectory:true.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5635
        self currentFileNameHolder value:copiedFiles values.
f9bed8385350 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6373
diff changeset
  5636
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5637
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5638
321c1729db5b initial checkin
penk
parents:
diff changeset
  5639
renameFile:aFile 
321c1729db5b initial checkin
penk
parents:
diff changeset
  5640
    "rename the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5641
9793
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5642
    ^ self renameFiles:(Array with:aFile).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5643
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5644
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5645
renameFile:filename to:newFileString update:aBoolean
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5646
    "rename filename to newFileString"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5647
321c1729db5b initial checkin
penk
parents:
diff changeset
  5648
    |rename|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5649
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5650
    rename := FileOperation renameFile:filename to:newFileString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5651
    rename result ifTrue:[
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5652
        aBoolean ifTrue:[
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5653
            self updateAndSelect:(rename renamedFiles).
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  5654
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5655
    ] ifFalse:[
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  5656
        self notify:rename errorString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5657
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  5658
    ^ rename result
321c1729db5b initial checkin
penk
parents:
diff changeset
  5659
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5660
321c1729db5b initial checkin
penk
parents:
diff changeset
  5661
renameFiles:aColOfFiles 
6373
16fb0a500e0d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6371
diff changeset
  5662
    "rename some file(s)"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5663
321c1729db5b initial checkin
penk
parents:
diff changeset
  5664
    |rename|
321c1729db5b initial checkin
penk
parents:
diff changeset
  5665
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  5666
    rename := FileOperation renameFiles:aColOfFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5667
    rename result ifFalse:[
9793
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5668
        self notify:rename errorString.
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5669
        ^ nil.
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5670
    ].
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5671
    ^ rename
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5672
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5673
321c1729db5b initial checkin
penk
parents:
diff changeset
  5674
renameSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  5675
    "rename the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  5676
9793
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5677
    |renamed|
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5678
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5679
    renamed := self renameFiles:(self currentSelectedObjects copy).
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5680
    renamed notNil ifTrue:[
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5681
        self updateAndSelect:renamed renamedFiles.
df3c1b8165fa variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents: 9784
diff changeset
  5682
    ].
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5683
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  5684
    "Modified: / 04-12-2006 / 13:15:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5685
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5686
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5687
!AbstractFileBrowser methodsFor:'menu accessing'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5688
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  5689
bookmarksMenu
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5690
    <resource: #programMenu>
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5691
14941
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5692
    ^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec.
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5693
!
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5694
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5695
bookmarksMenuForBaseSpec:aBaseMenuSpec
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5696
    <resource: #programMenu>
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5697
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5698
    |menu bookmarks|
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5699
14941
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5700
    menu := aBaseMenuSpec decodeAsLiteralArray.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5701
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5702
    "/ add the bookmark items ...
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5703
    bookmarks := self class directoryBookmarks.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5704
    bookmarks notEmptyOrNil ifTrue:[
14604
8cbf91f053fa class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14593
diff changeset
  5705
        menu addSeparator.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5706
        bookmarks do:[:dirName |
12963
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5707
            menu addItem:(MenuItem 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5708
                            label:dirName asString 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5709
                            itemValue:[
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5710
                                (self currentSelectedDirectories includes:dirName) ifFalse:[
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5711
                                    self setCurrentFileName:dirName.
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5712
                                ].
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5713
                            ]).
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5714
        ].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5715
    ].
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5716
    menu findGuiResourcesIn:self.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5717
    ^ menu
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5718
11135
59e1d94df37f hg menu preps
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  5719
    "Modified: / 14-01-2012 / 21:14:03 / cg"
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5720
!
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5721
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5722
canBackward
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5723
    ^ self directoryHistory canBackward.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5724
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5725
    "Modified: / 27-03-2007 / 10:54:55 / cg"
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5726
!
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5727
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5728
canForward
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5729
    ^ self directoryHistory canForward.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5730
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5731
    "Modified: / 27-03-2007 / 10:54:57 / cg"
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
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  5734
gotoBookmarksMenu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5735
    <resource: #programMenu>
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5736
14941
feeeea13426b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14742
diff changeset
  5737
    ^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec2.
6099
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  5738
!
a7263cc8183d bookmarks
Claus Gittinger <cg@exept.de>
parents: 6096
diff changeset
  5739
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5740
menuDirHistory:backOrForward
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5741
    "initialize the history menu"
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5742
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5743
    <resource: #programMenu >
321c1729db5b initial checkin
penk
parents:
diff changeset
  5744
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5745
    |hist menu pathList currentSel currentPath|
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5746
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5747
    hist := self directoryHistory.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5748
    hist isEmpty ifTrue:[^ nil].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5749
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5750
    backOrForward == #back ifTrue:[
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  5751
        currentSel := self currentSelectedDirectories.
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5752
        currentSel size == 1 ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5753
            currentPath := currentSel first asString.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5754
        ] ifFalse:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5755
            currentPath := nil.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
  5756
        ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5757
        pathList := hist getBackCollection.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5758
    ] ifFalse:[
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5759
        pathList := hist getForwardCollection.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5760
    ].
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
  5761
    pathList isEmpty ifTrue:[ ^ nil].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5762
6370
eef587af6aa5 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6369
diff changeset
  5763
    pathList size > 30 ifTrue:[
eef587af6aa5 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6369
diff changeset
  5764
        pathList := pathList copyTo:30
eef587af6aa5 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6369
diff changeset
  5765
    ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5766
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5767
    menu := Menu new.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5768
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  5769
    pathList do:[:aPath| 
14593
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5770
        menu addItem:(MenuItem
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5771
                        label:aPath
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5772
                        itemValue:[ self setCurrentFileName:(aPath asFilename) ]
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5773
                        translateLabel:false).
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5774
    ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5775
    menu findGuiResourcesIn:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5776
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5777
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5778
    "Modified: / 09-09-2012 / 13:07:22 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5779
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5780
321c1729db5b initial checkin
penk
parents:
diff changeset
  5781
menuDirHistoryBack
321c1729db5b initial checkin
penk
parents:
diff changeset
  5782
    "initialize the directory menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  5783
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  5784
    <resource: #programMenu >
321c1729db5b initial checkin
penk
parents:
diff changeset
  5785
321c1729db5b initial checkin
penk
parents:
diff changeset
  5786
    ^ self menuDirHistory:#back.
321c1729db5b initial checkin
penk
parents:
diff changeset
  5787
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  5788
321c1729db5b initial checkin
penk
parents:
diff changeset
  5789
menuDirHistoryForward
321c1729db5b initial checkin
penk
parents:
diff changeset
  5790
    "initialize the directory menu
321c1729db5b initial checkin
penk
parents:
diff changeset
  5791
    "
321c1729db5b initial checkin
penk
parents:
diff changeset
  5792
    <resource: #programMenu >
321c1729db5b initial checkin
penk
parents:
diff changeset
  5793
321c1729db5b initial checkin
penk
parents:
diff changeset
  5794
    ^ self menuDirHistory:#forward.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5795
!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5796
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5797
menuFileHistory
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5798
    "initialize the file history menu
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5799
    "
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5800
    <resource: #programMenu >
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5801
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5802
    |menu hist text removeItem|
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5803
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5804
    hist := self fileHistory.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5805
    hist isEmpty ifTrue:[^ nil].
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5806
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5807
    menu := Menu new.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5808
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5809
    hist copy do:[:aFileItem|
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5810
        aFileItem fileName exists ifTrue:[
12963
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5811
            menu addItem:(MenuItem 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5812
                            label: aFileItem fileName asString 
14593
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5813
                            itemValue:
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5814
                                [
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5815
                                    self setCurrentFileName:(aFileItem fileName).
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5816
                                    self openApplByFileItem:aFileItem
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5817
                                ]
ef995669e26f class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14588
diff changeset
  5818
                            translateLabel:false).
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5819
        ] ifFalse:[
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5820
            "/ remove all not existing history entries
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5821
            hist remove:aFileItem.
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5822
        ]
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5823
    ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5824
    menu addSeparator.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5825
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5826
    removeItem := MenuItem new.
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5827
    removeItem translateLabel:true.
4391
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5828
    text := resources string:'Clear History'.
05ad03de6f3c no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents: 4368
diff changeset
  5829
    "/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text.
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5830
    removeItem label:text.
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5831
    removeItem 
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5832
        itemValue:[
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5833
            self fileHistory removeAll.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5834
            self enableFileHistory value:false.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5835
        ].
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5836
    menu addItem:removeItem.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5837
    menu findGuiResourcesIn:self.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  5838
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5839
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5840
    "Modified (format): / 09-09-2012 / 13:07:36 / cg"
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5841
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5842
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5843
sortMenu
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5844
    <resource: #programMenu >
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5845
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5846
    |menu|
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5847
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5848
    menu :=  Menu decodeFromLiteralArray:self class sortMenu.
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5849
    menu findGuiResourcesIn:self.
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5850
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5851
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5852
    "Modified: / 27-03-2007 / 10:47:42 / cg"
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5853
!
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5854
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5855
viewDetailsMenuSpec
4976
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5856
    |specContentsBrowser itemsContentsBrowser specHere itemsHere spec| 
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5857
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5858
    specHere := self class viewDetailsMenuSpec.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5859
    itemsHere := specHere at:2.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5860
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5861
    specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5862
    itemsContentsBrowser := (specContentsBrowser at:2).
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5863
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5864
    spec := specHere copy.
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5865
    spec at:2 put:(itemsContentsBrowser , itemsHere).
86594f3f8a9b refactoring column visibility holder of DirectoryContentsBrowser
penk
parents: 4974
diff changeset
  5866
    ^ spec
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5867
!
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5868
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5869
viewInContentsBrowserMenu
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5870
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5871
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5872
        ifPresentDo:[:appl | ^ appl viewBrowserMenu].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5873
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  5874
    ^ nil.
4080
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5875
!
c32f68f51f47 translation to german
penk
parents: 4075
diff changeset
  5876
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5877
visitedDirectoriesMenu
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5878
    <resource: #programMenu >
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5879
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5880
    |menu histCopy text removeItem|
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5881
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5882
    histCopy := self directoryHistory.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5883
    histCopy isEmpty ifTrue:[^ nil].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5884
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5885
    menu := Menu new.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5886
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5887
    histCopy do:[:aFile| 
12963
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5888
        menu addItem:(MenuItem 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5889
                        label:aFile asString 
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5890
                        itemValue:[
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5891
                            self setCurrentFileName:(aFile path asFilename).
b8da6d54c50a class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12874
diff changeset
  5892
                        ]).
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5893
    ].
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5894
    menu addSeparator.
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5895
4672
185a4d75348f common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents: 4663
diff changeset
  5896
    "/ 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
  5897
    text := (resources string:'Clear History').
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5898
    removeItem := MenuItem new.
4040
c880438f2554 *** empty log message ***
penk
parents: 4034
diff changeset
  5899
    removeItem translateLabel:true.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5900
    removeItem label:text.
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5901
    removeItem 
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5902
        itemValue:[
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5903
            self directoryHistory removeAll.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5904
            self enableForward value:self canForward.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5905
            self enableBack value:self canBackward.
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5906
        ].
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5907
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5908
    menu addItem:removeItem.
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5909
    menu findGuiResourcesIn:self.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  5910
    ^ menu
7763
6a17ca4cef7b use decodeFromLiteralArray:
Claus Gittinger <cg@exept.de>
parents: 7635
diff changeset
  5911
11783
40139e220343 menuitem protocol
Claus Gittinger <cg@exept.de>
parents: 11767
diff changeset
  5912
    "Modified: / 09-09-2012 / 13:07:45 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  5913
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  5914
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5915
!AbstractFileBrowser methodsFor:'menu actions'!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5916
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5917
doCompareTwoFiles
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5918
    self openDiffView.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5919
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5920
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5921
doGoDirectoryUp
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5922
    "navigate up to the parent folder"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5923
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5924
    | upDir directory rootInTreeView|
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5925
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5926
    self enableDirectoryUp value ifFalse:[ ^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5927
    self currentFilesAreInSameDirectory ifTrue:[
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5928
        directory := self currentDirectory.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5929
        directory isNil ifTrue:[ ^ self].
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5930
    ] ifFalse:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5931
        rootInTreeView := self 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5932
                            applicationNamed:#DirectoryTreeBrowser 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5933
                            ifPresentDo:[:appl | appl rootHolder].
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5934
        directory := rootInTreeView value asFilename.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5935
    ].
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  5936
    upDir := directory directory.
5959
27c1d00a790d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5956
diff changeset
  5937
    self setCurrentFileName:upDir.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5938
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5939
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5940
doGotoDefaultDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5941
    "navigate to the default folder (is the current directory)"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5942
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5943
    self gotoFile:(Filename defaultDirectory).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5944
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5945
8091
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5946
doGotoDesktopDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5947
    "navigate to the desktop folder"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5948
8091
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5949
    self gotoFile:(Filename desktopDirectory).
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5950
!
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5951
18036
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5952
doGotoDocumentsDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5953
    "navigate to the documents folder"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5954
18036
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5955
    self gotoFile:(Filename documentsDirectory).
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5956
!
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5957
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5958
doGotoDownloadsDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5959
    "navigate to the downloads folder"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5960
18036
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5961
    self gotoFile:(Filename downloadsDirectory).
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5962
!
8693f7f542d5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18024
diff changeset
  5963
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5964
doGotoHomeDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5965
    "navigate to the home folder"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5966
8091
803f4df78b72 +goto desktop directory
Claus Gittinger <cg@exept.de>
parents: 8088
diff changeset
  5967
    self gotoFile:(Filename homeDirectory).
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5968
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  5969
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5970
doGotoSmalltalkDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5971
    "navigate to the smalltalk bin folder (where the stx executable is)"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5972
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5973
    self gotoFile:(self smalltalkDirectory).
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5974
!
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  5975
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5976
doGotoSmalltalkWorkspaceDirectory
18511
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5977
    "navigate to the user's smalltalk workspace folder"
4b7bd1293f9d #FEATURE by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18478
diff changeset
  5978
17187
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5979
    self gotoFile:(UserPreferences current workspaceDirectory).
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5980
!
3dcae3e757cd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17182
diff changeset
  5981
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5982
doGotoTempDirectory
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5983
    self gotoFile:(self tempDirectory).
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5984
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5985
    "Created: / 29-12-2010 / 11:03:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5986
!
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  5987
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5988
doMakeCurrentDirectory
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5989
    <resource: #obsolete>
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5990
    
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5991
    "/ no longer
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5992
    ^ self
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5993
"/    OperatingSystem setCurrentDirectory:(self currentDirectory pathName).
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5994
"/    self currentFileNameHolderChangedForCommon.
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5995
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5996
    "Created: / 26-10-2010 / 17:21:19 / cg"
17582
e12643cd5864 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17485
diff changeset
  5997
    "Modified (format): / 17-07-2017 / 10:09:39 / cg"
9596
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5998
!
Claus Gittinger <cg@exept.de>
parents: 9582
diff changeset
  5999
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6000
fileGetInfo:longInfo 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6001
    "get info on selected file - show it in a box"
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6002
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6003
    |string box updater|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6004
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6005
    string := self getFileInfoStringForFirstSelectedFile:longInfo.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6006
    string notNil ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6007
        box := InfoBox title:string.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6008
        updater := [
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6009
                    [true] whileTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6010
                        Delay waitForSeconds:2.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6011
                        string := self getFileInfoStringForFirstSelectedFile:longInfo.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6012
                        string isNil ifTrue:[ ^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6013
                        box title:string
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6014
                    ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6015
                ] fork.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6016
        box show.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6017
        updater terminate.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6018
        box destroy
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6019
    ]
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  6020
!
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  6021
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6022
showDeltaBetweenTwoImageFiles
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6023
     |i1 i2 delta|
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6024
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6025
     i1 := Image fromFile:(self selectedFileNames first).
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6026
     i2 := Image fromFile:(self selectedFileNames second).
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6027
     delta := ImageAlgorithms new differenceImageBetween:i1 and:i2.
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6028
     ImageView openOn:delta.
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6029
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6030
    "Created: / 10-09-2017 / 16:59:08 / cg"
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6031
!
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  6032
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  6033
smalltalkDirectory
8590
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  6034
    |stxPath|
6434
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  6035
b856db206ea3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6433
diff changeset
  6036
    stxPath := OperatingSystem pathOfSTXExecutable.
8590
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  6037
    stxPath isNil ifTrue:[
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  6038
        ^ Filename currentDirectory
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  6039
    ].
ed2ee3a6e866 changed #smalltalkDirectory
Claus Gittinger <cg@exept.de>
parents: 8588
diff changeset
  6040
    ^ stxPath asFilename directory.
9677
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  6041
!
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  6042
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  6043
tempDirectory
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  6044
    ^ Filename tempDirectory.
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  6045
Claus Gittinger <cg@exept.de>
parents: 9675
diff changeset
  6046
    "Created: / 29-12-2010 / 11:03:00 / cg"
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6047
! !
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6048
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6049
!AbstractFileBrowser methodsFor:'menu actions-file'!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6050
14262
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6051
addDirToJavaSourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6052
    "add the current path to java's sourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6053
     (only available with ST/J System"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6054
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6055
    Java addToSourcePath:self currentDirectory pathName
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6056
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6057
    "Modified: 14.12.1996 / 15:37:47 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6058
    "Created: 2.8.1997 / 14:11:19 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6059
!
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6060
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6061
copyFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6062
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6063
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6064
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6065
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6066
cutFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6067
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6068
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6069
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6070
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6071
deleteFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6072
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6073
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6074
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6075
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6076
eraseFiles
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6077
    self 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6078
        withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6079
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6080
14262
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6081
fileAddToJavaSourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6082
    "add the current path to java's sourcePath
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6083
     (only available with ST/J System"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6084
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  6085
    Java notNil ifTrue:[
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  6086
        self currentSelectedObjects do:[:each |
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  6087
            Java addToSourcePath:(each pathName)
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  6088
        ].
14262
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6089
    ].
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6090
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6091
    "Created: / 9.11.1998 / 05:41:34 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6092
    "Modified: / 9.11.1998 / 05:56:00 / cg"
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6093
!
5a728b895f24 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14126
diff changeset
  6094
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6095
openSettingsDialog
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6096
    |dialog|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6097
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6098
    dialog := FileBrowserV2SettingsDialog new.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6099
    dialog settingsDialog:self.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6100
    dialog allButOpen.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6101
    dialog doReload.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6102
    dialog openWindow
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
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6105
withSelectedFilesOrDirectoriesDo:aBlock
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6106
    |files dirs|
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
    files := self currentSelectedFiles.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6109
    files notEmpty ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6110
        aBlock value:files.        
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6111
    ] ifFalse:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6112
        dirs := self currentSelectedDirectories.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6113
        dirs notEmpty ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6114
            aBlock value:dirs.        
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6115
        ].
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
! !
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6118
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6119
!AbstractFileBrowser methodsFor:'menu actions-help'!
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
openAboutThisApplication
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6122
    "opens an about box for this application."
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6123
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6124
    Dialog aboutClass:self class.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6125
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6126
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6127
openHTMLDocument:relativeDocPath
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6128
    HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6129
! !
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6130
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6131
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6132
15905
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6133
canCvsAddAndCommit
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6134
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6135
    |selectedFiles|
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6136
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6137
    selectedFiles := self currentSelectedObjects.
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6138
    ^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]).
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6139
!
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6140
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6141
canRemoveCVSContainer
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6142
    ^ self currentSelectedFiles 
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6143
        contains:[:fileName|
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6144
            |dirOfFile cvsDir|
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6145
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6146
            dirOfFile := self getDirWithoutFileName:fileName.
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6147
            cvsDir := dirOfFile construct:'CVS'.
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6148
            cvsDir isDirectory
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6149
        ].
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6150
!
24872df93617 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 15803
diff changeset
  6151
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6152
commitFilesToCVS:files
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6153
    |numFiles|
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6154
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6155
    (numFiles := files size) > 0 ifTrue:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6156
        self withActivityIndicationDo:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6157
            self cvsCommitFiles:files
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6158
        ]
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6159
    ]
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6160
!
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6161
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6162
cvsAddAndCommit
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6163
    self cvsAddAndCommitAsBinary:false
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6164
!
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6165
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6166
cvsAddAndCommitAsBinary:asBinary
8588
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6167
    |sel log logArg binArg cmd dir executionBlock nameString|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6168
321c1729db5b initial checkin
penk
parents:
diff changeset
  6169
    log := Dialog
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6170
        requestText:(resources string:'Enter initial log message:')
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6171
        lines:10
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6172
        columns:70
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6173
        initialAnswer:nil.
8322
cf10f08b6164 care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents: 8294
diff changeset
  6174
    log isNil ifTrue:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6175
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6176
    OperatingSystem isMSWINDOWSlike ifTrue:[
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6177
        logArg := '-m "' , log , '"'.
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6178
    ] ifFalse:[
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6179
        logArg := '-m ''' , log , ''''.
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6180
    ].
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6181
8588
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6182
    binArg := ''.
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6183
    asBinary ifTrue:[
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6184
        binArg := '-kb '.
e0b4240e621e cvs add -kb for turqoise
Claus Gittinger <cg@exept.de>
parents: 8568
diff changeset
  6185
    ].
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  6186
    sel := self currentSelectedFiles.
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6187
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6188
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6189
            log notNil ifTrue:[
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  6190
                sel notEmptyOrNil ifTrue:[
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6191
                    sel do:[:fn |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6192
                        |nameArg|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6193
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6194
                        nameArg := '"',fn baseName,'"'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6195
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6196
                        dir := self getDirWithoutFileName:fn.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6197
                        cmd := 'cvs add ',logArg,' ',binArg,nameArg.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6198
                        (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6199
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6200
                        cmd := ('cvs commit -l ',logArg,' ',nameArg).
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6201
                        (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6202
                        "/ mhmh - it seems that only old CVS implementations (at least turqoise)
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6203
                        "/ support and need the 'admin -kb' command.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6204
                        "/ newer ones use the '-kb' option in the 'cvs add' command
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6205
                        asBinary ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6206
                            cmd := ('cvs admin -kb ' , nameArg).
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6207
                            (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6208
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6209
                            cmd := ('cvs upd ' , nameArg).
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6210
                            (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6211
                        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6212
                    ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6213
                ] 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6214
            ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6215
        ].
4107
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6216
    nameString := 'Command> cvs add and commit'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6217
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6218
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  6219
    "Modified: / 17-02-2017 / 08:25:16 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6220
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6221
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6222
cvsAddBinaryAndCommit
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6223
    self cvsAddAndCommitAsBinary:true
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6224
!
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6225
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6226
cvsCommit
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6227
    |selectedFiles|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6228
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  6229
    selectedFiles:= self currentSelectedFiles.
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6230
    self cvsCommitFiles:selectedFiles
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6231
!
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6232
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6233
cvsCommitFiles:files
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6234
    |nFiles log logTmp s logArg msg executionBlock nameString |
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6235
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6236
    nFiles := files size.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6237
    nFiles == 0 ifTrue:[^ self].
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6238
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6239
    nFiles == 1 ifTrue:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6240
        msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6241
    ] ifFalse:[
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6242
        nFiles > 1 ifTrue:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6243
            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
  6244
        ] ifFalse:[
6627
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
  6245
            msg := resources string:'Enter log message for checkIn'
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6246
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6247
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6248
321c1729db5b initial checkin
penk
parents:
diff changeset
  6249
    log := Dialog
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6250
        requestText:msg
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6251
        lines:10
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6252
        columns:70
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6253
        initialAnswer:nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6254
4663
d11b898b6fc5 start no process when commit is canceled
penk
parents: 4655
diff changeset
  6255
    log isNil ifTrue:[^ self].
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6256
    log := log replChar:$"  withString:'\"'.
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6257
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6258
    OperatingSystem isMSWINDOWSlike ifTrue:[
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6259
        "/ save the log message into another tempFile ...
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6260
        s := FileStream newTemporary.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6261
        logTmp := s fileName.
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6262
        s nextPutAll:log.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6263
        s close.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6264
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6265
        logArg := '-F "', logTmp pathName, '"'.
6205
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6266
    ] ifFalse:[
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6267
        logArg := '-m ''' , log , ''''.
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6268
    ].
0c94c101cfde cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents: 6204
diff changeset
  6269
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  6270
    executionBlock := [:stream |
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6271
        [
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6272
            files do:[:fn |
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6273
                | dir nameArg cmd |
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6274
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6275
                nameArg := '"',fn baseName,'"'.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6276
                dir := fn directory.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6277
                cmd := 'cvs commit ',logArg,' ' , nameArg.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6278
stream showCR:fn pathName.
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6279
                (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
4663
d11b898b6fc5 start no process when commit is canceled
penk
parents: 4655
diff changeset
  6280
            ] 
12777
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6281
        ] ensure:[
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6282
            logTmp notNil ifTrue:[ logTmp remove ].
0221a2b95d8c class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12760
diff changeset
  6283
        ].
4107
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6284
    ].
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6285
    nameString := 'Command> cvs commit'.
d158469338e5 *** empty log message ***
penk
parents: 4101
diff changeset
  6286
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6287
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6288
14527
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6289
cvsCommitFolder
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6290
    |dir log logTmp s logArg msg executionBlock nameString |
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6291
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6292
    (dir := self currentDirectory) isNil ifTrue:[ ^ self ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6293
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6294
    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
  6295
    log := Dialog
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6296
        requestText:msg
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6297
        lines:10
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6298
        columns:70
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6299
        initialAnswer:nil.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6300
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6301
    log isNil ifTrue:[^ self].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6302
    log := log replChar:$"  withString:'\"'.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6303
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6304
    OperatingSystem isMSWINDOWSlike ifTrue:[
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6305
        "/ save the log message into another tempFile ...
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6306
        s := FileStream newTemporary.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6307
        logTmp := s fileName.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6308
        s nextPutAll:log.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6309
        s close.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6310
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6311
        logArg := '-F "', logTmp pathName, '"'.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6312
    ] ifFalse:[
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6313
        logArg := '-m ''' , log , ''''.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6314
    ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6315
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6316
    executionBlock := [:stream |
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6317
            [
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6318
                |cmd|
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6319
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6320
                cmd := 'cvs commit ',logArg.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6321
                (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6322
            ] ensure:[
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6323
                logTmp notNil ifTrue:[ logTmp remove ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6324
            ].
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6325
        ]. 
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6326
    
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6327
    nameString := 'Command> cvs commit'.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6328
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6329
!
5d2cb6b8ac49 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14497
diff changeset
  6330
9407
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6331
cvsCompareWithNewest
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6332
    |selectedFiles|
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6333
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6334
    selectedFiles:= self currentSelectedFiles.
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6335
    selectedFiles do:[:each |
11176
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6336
        |out diffs|
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6337
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  6338
        out := CharacterWriteStream new:100.
11176
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6339
        OperatingSystem 
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6340
            executeCommand:'cvs diff -b ',each baseName
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6341
            outputTo:out
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6342
            inDirectory:each directoryName.
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6343
        diffs := out contents.
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6344
        TextView openWith:diffs.
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6345
    ].
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6346
eb02b211e777 changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  6347
    "Modified: / 23-01-2012 / 14:08:28 / cg"
9407
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6348
!
cf114ba82b6d added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents: 9405
diff changeset
  6349
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6350
cvsRemoveAndRemoveFromCVS:filesToRemove
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6351
    "remove the selected file(s) and their CVS containers - no questions asked"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6352
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6353
    |toRemove updateRunning executionBlock nameString|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6354
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6355
    updateRunning := self backgroundProcesses value notEmpty.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6356
    self killAllRunningBackgroundProcesses.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6357
    toRemove := OrderedCollection new.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6358
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6359
    executionBlock := 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6360
        [:stream |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6361
            |cmd logArg prevDir prevFiles|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6362
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6363
            OperatingSystem isMSWINDOWSlike ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6364
                logArg := '-m "' , 'removed via FileBrowser' , '"'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6365
            ] ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6366
                logArg := '-m ''' , 'removed via FileBrowser' , ''''.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6367
            ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6368
            prevFiles := ''.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6369
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6370
            filesToRemove do:[:fileName |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6371
                |dir file|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6372
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6373
                dir := fileName directory.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6374
                (prevDir notNil and:[prevDir ~= dir]) ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6375
                    cmd := 'cvs commit -l ',logArg, ' ',prevFiles.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6376
                    "/ Transcript show:prevDir; space; showCR:cmd.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6377
                    (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6378
                    prevFiles := ''.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6379
                ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6380
17116
625f4a3de032 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17024
diff changeset
  6381
                OsError handle:[:ex|
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6382
                    "was not able to remove it"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6383
                    | lastError msg |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6384
                    lastError := OperatingSystem lastErrorString.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6385
                    msg := (resources string:'cannot remove ''%1'' !!' with:fileName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6386
                    lastError isNil ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6387
                        msg := msg , '\\(' , lastError , ')'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6388
                    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6389
                    Dialog warn:msg withCRs
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6390
                ] do:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6391
                    (fileName isSymbolicLink) ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6392
                        fileName remove.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6393
                        file := fileName baseName.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6394
                        cmd := ('cvs remove -f "',file,'"').
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6395
                        (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6396
                        "/ Transcript show:dir; space; showCR:cmd.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6397
                    ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6398
                ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6399
                prevDir := dir.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6400
                prevFiles := prevFiles,' ',file.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6401
            ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6402
            cmd := 'cvs commit -l ',logArg, ' ',prevFiles.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6403
            "/ Transcript show:prevDir; space; showCR:cmd.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6404
            (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6405
        ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6406
    nameString := 'Command> cvs remove and commit ', filesToRemove first baseName.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6407
    filesToRemove size > 1 ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6408
        nameString := nameString, ' ...'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6409
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6410
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  6411
!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6412
321c1729db5b initial checkin
penk
parents:
diff changeset
  6413
cvsRemoveFileAndCVSContainer
12493
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6414
    |files|
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6415
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6416
    files := self currentSelectedFiles copy.
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6417
    self removeFilesAndCVSContainers:files
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6418
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6419
9338
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6420
cvsRevisionLog
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6421
    | cmd sel executionBlock nameString|
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6422
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6423
    sel := self currentSelectedObjects.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6424
    sel isEmpty ifTrue:[ ^ self ].
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6425
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6426
    executionBlock := [:stream |
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6427
        sel do:[:fn |
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6428
            | dir nameArg |
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6429
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6430
            nameArg := '"',fn baseName,'"'.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6431
            dir := fn directory.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6432
            cmd := 'cvs log ' , nameArg.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6433
            (self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6434
        ]
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6435
    ].
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6436
    nameString := 'Command> cvs log'.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6437
    self makeExecutionResultProcessFor:executionBlock withName:nameString.
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6438
!
22c2331c216e added: #cvsRevisionLog
Claus Gittinger <cg@exept.de>
parents: 9319
diff changeset
  6439
8562
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6440
cvsTagSelection
12856
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6441
    |tag tags cmd|
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6442
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6443
    tag := Dialog
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6444
                request:(resources string:'Tag (possibly multiple, separated by ";"):')
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6445
                initialAnswer:(CVSSourceCodeManager recentTag).
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6446
    tag isEmptyOrNil ifTrue:[^ self ].
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6447
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6448
    CVSSourceCodeManager recentTag:tag.
8562
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6449
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6450
    CVSSourceCodeManager notNil ifTrue:[
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6451
        cmd := CVSSourceCodeManager cvsExecutable.
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6452
    ] ifFalse:[
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6453
        cmd := 'cvs'.
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6454
    ].
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6455
12856
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6456
    tags := tag asCollectionOfSubstringsSeparatedByAny:',;'.
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6457
    tags do:[:eachTag |
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6458
        self executeCommand:('%1 tag -F "%2" %3' 
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6459
                                bindWith:cmd 
12858
d9d33f96ea6b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12856
diff changeset
  6460
                                with:(eachTag withoutSeparators) 
12856
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6461
                                with:(self makeFileNameArgumentString))
bd934ddf8ba3 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12850
diff changeset
  6462
    ].
8562
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6463
!
5f9f73f56b6a tag from menu
Claus Gittinger <cg@exept.de>
parents: 8560
diff changeset
  6464
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6465
cvsUpdateAll
321c1729db5b initial checkin
penk
parents:
diff changeset
  6466
    | cmd |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6467
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6468
    CVSSourceCodeManager notNil ifTrue:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6469
        cmd := CVSSourceCodeManager cvsExecutable.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6470
    ] ifFalse:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6471
        cmd := 'cvs'.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6472
    ].
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6473
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6474
    self executeCommand:(cmd, ' upd -l').
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6475
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6476
321c1729db5b initial checkin
penk
parents:
diff changeset
  6477
cvsUpdateAllRecursive
321c1729db5b initial checkin
penk
parents:
diff changeset
  6478
    | cmd |
321c1729db5b initial checkin
penk
parents:
diff changeset
  6479
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6480
    CVSSourceCodeManager notNil ifTrue:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6481
        cmd := CVSSourceCodeManager cvsExecutable.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6482
    ] ifFalse:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6483
        cmd := 'cvs'.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6484
    ].
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6485
    self executeCommand:(cmd, ' upd -d').
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6486
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6487
321c1729db5b initial checkin
penk
parents:
diff changeset
  6488
cvsUpdateSelection
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6489
    |stream cmd|
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6490
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6491
    CVSSourceCodeManager notNil ifTrue:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6492
        cmd := CVSSourceCodeManager cvsExecutable.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6493
    ] ifFalse:[
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6494
        cmd := 'cvs'.
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6495
    ].
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6496
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  6497
    stream := CharacterWriteStream new.
8563
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6498
    stream 
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6499
        nextPutAll:cmd; 
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6500
        nextPutAll:' upd ';
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6501
        nextPutAll:(self makeFileNameArgumentString).
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6502
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6503
    self executeCommand:stream contents.
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6504
!
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6505
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6506
makeFileNameArgumentString
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6507
    |stream|
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6508
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  6509
    stream := CharacterWriteStream new.
8042
5a4655a03124 Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 8039
diff changeset
  6510
    self currentSelectedFiles do:[: file |
8563
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6511
        stream nextPut:$".
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6512
        stream nextPutAll:file baseName.
8563
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6513
        stream nextPutAll:'" '.
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6514
    ].
c5f9ee660edc tag from menu
Claus Gittinger <cg@exept.de>
parents: 8562
diff changeset
  6515
    ^ stream contents.
12493
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6516
!
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6517
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6518
removeFilesAndCVSContainers:files
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6519
    |numFiles question aswer|
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6520
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6521
    (numFiles := files size) > 0 ifTrue:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6522
        numFiles > 1 ifTrue:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6523
            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
  6524
        ] ifFalse:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6525
            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
  6526
        ].
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6527
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6528
        aswer := Dialog 
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6529
                confirm:question withCRs
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6530
                yesLabel:(resources string:'Remove')
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6531
                noLabel:(resources string:'Cancel').
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6532
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6533
        aswer ifTrue:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6534
            self withActivityIndicationDo:[
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6535
                self cvsRemoveAndRemoveFromCVS:files
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6536
            ]
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6537
        ]
c7d274544ad6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12481
diff changeset
  6538
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6539
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6540
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  6541
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6542
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6543
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6544
mercurialAdd
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6545
    |executionBlock sel maxCmdSize|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6546
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6547
    maxCmdSize := 512.
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
    sel := self currentSelectedObjects.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6550
    sel isEmptyOrNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6551
        ^ self
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6552
    ].
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
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6555
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6556
            |prevDir cmd|
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
            prevDir := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6559
            sel do:[:fn |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6560
                |nameArg dir|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6561
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6562
                nameArg := '"',fn baseName,'"'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6563
                dir := fn directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6564
                (dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6565
                    "/ flush
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6566
                    cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6567
                        (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6568
                        cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6569
                    ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6570
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6571
                cmd isNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6572
                    cmd := 'hg add'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6573
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6574
                cmd := cmd,' ',nameArg.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6575
                prevDir := dir.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6576
            ].
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
            stream nextPutLine:'Commit to finish the transaction'. 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6582
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6583
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6584
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6585
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6586
    "Created: / 15-01-2012 / 15:55:47 / cg"
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
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6589
mercurialCommit
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6590
    |dir executionBlock|
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
"/    dir := self currentDirectory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6593
    dir := self directoryContentsBrowser directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6594
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6595
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6596
            (self getExecutionBlockForCommand:'hg commit' 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6597
                  inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6598
            stream nextPutLine:'Push to sync other repositories'. 
6169
Claus Gittinger <cg@exept.de>
parents: 6151
diff changeset
  6599
        ].
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6600
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6601
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6602
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6603
    "Created: / 15-01-2012 / 16:21:27 / cg"
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6604
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6605
11144
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6606
mercurialInit
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6607
    |dir executionBlock|
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6608
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6609
    dir := self directoryContentsBrowser directory.
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6610
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6611
    (Dialog confirm:(resources 
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6612
                        string:'Initialize new Mercurial Repository in %1?'
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6613
                        with:dir baseName)) ifFalse:[^ self].
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6614
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6615
    executionBlock := 
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6616
        [:stream |
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6617
            (self getExecutionBlockForCommand:('hg init')
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6618
                  inDirectory:dir) value:stream.
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6619
        ].
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6620
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6621
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'.
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6622
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6623
    "Created: / 17-01-2012 / 15:58:46 / cg"
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6624
!
489fd65ec36b added: #mercurialInit
Claus Gittinger <cg@exept.de>
parents: 11139
diff changeset
  6625
11139
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6626
mercurialPush
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6627
    |destination dir executionBlock|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6628
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6629
    destination := Dialog request:'Mercurial Repository'
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6630
                    initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName).
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6631
    destination isEmptyOrNil ifTrue:[^ self].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6632
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6633
    LastMercurialRepository := destination.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6634
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6635
    dir := self directoryContentsBrowser directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6636
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6637
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6638
            (self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination)
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6639
                  inDirectory:dir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6640
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6641
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6642
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6643
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6644
    "Created: / 15-01-2012 / 16:29:41 / cg"
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6645
!
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6646
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6647
mercurialStatus
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6648
    |executionBlock sel maxCmdSize|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6649
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6650
    maxCmdSize := 512.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6651
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6652
    sel := self currentSelectedObjects.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6653
    sel isEmptyOrNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6654
        ^ self
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6655
    ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6656
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6657
    executionBlock := 
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6658
        [:stream |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6659
            |prevDir cmd|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6660
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6661
            prevDir := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6662
            sel do:[:fn |
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6663
                |nameArg dir|
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6664
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6665
                nameArg := '"',fn baseName,'"'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6666
                dir := fn directory.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6667
                (dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6668
                    "/ flush
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6669
                    cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6670
                        (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6671
                        cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6672
                    ]
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6673
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6674
                cmd isNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6675
                    cmd := 'hg status'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6676
                ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6677
                cmd := cmd,' ',nameArg.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6678
                prevDir := dir.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6679
            ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6680
            cmd notNil ifTrue:[
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6681
                (self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6682
                cmd := nil.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6683
            ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6684
        ].
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6685
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6686
    self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'.
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6687
e3089114c08d class definition
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
  6688
    "Created: / 15-01-2012 / 19:43:08 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6689
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  6690
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  6691
!AbstractFileBrowser methodsFor:'menu actions-tools'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6692
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  6693
allFilesInSelectedDirectoriesForWhich:aBlock
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  6694
    ^ self class allFilesInDirectories:(self currentSelectedDirectories) forWhich:aBlock
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  6695
!
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  6696
18426
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6697
changeSetFromGSTSource
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6698
    GSTFileReader isNil ifTrue:[ Smalltalk loadPackage:'stx:libbasic2'].
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6699
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6700
    self withWaitCursorDo:[
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6701
        self currentSelectedFiles do:[:fn |
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6702
            |changeSet|
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6703
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  6704
            (fn suffix sameAs:'st') ifTrue:[
18426
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6705
                changeSet := GSTFileReader new changeSetFromStream:fn readStream.
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6706
                (Tools::ChangeSetBrowser2 
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6707
                        on: changeSet
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6708
                        label: fn baseName)
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6709
                    beTwoColumn;
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6710
                    targetNamespace:nil;
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6711
                    targetPackage:nil;
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6712
                    open
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6713
                ]
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6714
        ]
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6715
    ]
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6716
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6717
    "Created: / 23-09-2018 / 01:32:46 / Claus Gittinger"
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  6718
    "Modified: / 01-05-2019 / 11:21:34 / Claus Gittinger"
18426
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6719
!
7a6813ed8ec0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18389
diff changeset
  6720
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6721
conversionChainFrom:inSuffix to:outSuffix
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6722
    |conv|
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6723
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6724
    inSuffix = outSuffix ifTrue:[
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6725
        ^ nil
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6726
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6727
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6728
    "/ 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
  6729
    "/ 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
  6730
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6731
    conv := OrderedCollection new.
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6732
    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
  6733
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6734
    outSuffix = 'png' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6735
        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
  6736
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6737
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6738
    outSuffix = 'gif' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6739
        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
  6740
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6741
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6742
    outSuffix = 'xpm' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6743
        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
  6744
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6745
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6746
    outSuffix = 'jpg' ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6747
        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
  6748
        ^ conv.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6749
    ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6750
    self error:'unimplemented conversion'.
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6751
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6752
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6753
convertImageFrom:fileName to:outFile onError:exceptionBlock
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6754
    |writer image outSuffix|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6755
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6756
    outSuffix := outFile suffix.
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
    ((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6759
    and:[ (image := Image fromFile:fileName) notNil
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6760
    and:[ writer canRepresent:image ]]) ifTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6761
        "/ can do it with Smalltalk tools
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6762
        writer save:image onFile:outFile.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6763
    ] ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6764
        "/ use external tools (pbm-package, if available)
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6765
        self 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6766
            convertImageUsingExternalFileToolsFrom:fileName 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6767
            toSuffix:outSuffix 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6768
            onError:exceptionBlock.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6769
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6770
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6771
    "Created: / 20-05-2010 / 11:12:36 / cg"
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6772
!
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6773
4367
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6774
convertImageToGIF
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6775
    self convertImageToSuffix:'gif'
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6776
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6777
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6778
convertImageToJPG
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6779
    self convertImageToSuffix:'jpg'
4531
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  6780
!
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  6781
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  6782
convertImageToPNG
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6783
    self convertImageToSuffix:'png'
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6784
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6785
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6786
convertImageToSuffix:outSuffix
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6787
    |outFile filesToConvert|
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
    self withActivityIndicationDo:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6790
        filesToConvert := self currentSelectedObjects copy.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6791
        filesToConvert do:[:fileName |
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6792
            self notify:(resources string:'Converting: %1...' with:fileName baseName).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6793
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  6794
            fileName isRegularFile ifTrue:[
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6795
                |skip|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6796
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6797
                skip := false.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6798
                outFile := fileName withSuffix:outSuffix.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6799
                outFile exists ifTrue:[
4722
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6800
                    |answer|
62f29a42dded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4721
diff changeset
  6801
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6802
                    answer := Dialog 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6803
                        confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold)
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6804
                        default:false.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6805
                    answer isNil ifTrue:[AbortSignal raise].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6806
                    answer ifFalse:[ skip := true ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6807
                ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6808
                skip ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6809
                    self 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6810
                        convertImageFrom:fileName 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6811
                        to:outFile 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6812
                        onError:[:errMsg |
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6813
                            filesToConvert size == 1 ifTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6814
                                Dialog warn:errMsg
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6815
                            ] ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6816
                                (Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6817
                                    ^ self
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6818
                                ]
4721
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6819
                            ].
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6820
                        ].
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6821
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6822
                    self updateAndSelect:nil.
4367
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6823
                ]
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6824
            ]
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6825
        ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6826
        self notify:nil.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6827
    ]
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6828
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6829
    "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
  6830
!
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6831
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6832
convertImageToXPM
2fe2500194e6 more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents: 4708
diff changeset
  6833
    self convertImageToSuffix:'xpm'
4367
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6834
!
ec4531103e69 convert to gif implemented
penk
parents: 4366
diff changeset
  6835
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6836
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6837
    |inFile outFile chainOfConversions conversionStream 
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6838
     eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6839
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6840
    chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6841
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6842
    chainOfConversions isNil ifTrue:[ 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6843
        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
  6844
        ^ false 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6845
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6846
    conversionStream := chainOfConversions readStream.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6847
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6848
    inFile := fileName.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6849
    eachConversionSuffixCommandPair := conversionStream next.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6850
    eachConversionCommand := eachConversionSuffixCommandPair key.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6851
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6852
    eachConversionCommand == #readToXPM ifTrue:[
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6853
        |image tempStreamXPM|
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6854
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6855
        image := Image fromFile:(inFile pathName).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6856
        image isNil ifTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6857
            self warn:'Unknown format/not an image: ' , inFile baseName.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6858
            ^ false.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6859
        ].
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6860
        tempStreamXPM  := FileStream newTemporaryWithSuffix:'xpm'.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6861
        XPMReader save:image onStream:tempStreamXPM.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6862
        tempStreamXPM close.
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6863
        inFile := tempStreamXPM fileName.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6864
        eachConversionSuffixCommandPair := conversionStream next.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6865
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6866
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6867
    [
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6868
        |command errOutput errMsg|
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6869
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6870
        [eachConversionSuffixCommandPair notNil] whileTrue:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6871
            eachConversionCommand := eachConversionSuffixCommandPair key.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6872
            eachConversionSuffix  := eachConversionSuffixCommandPair value.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6873
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6874
            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
  6875
13121
aa4a53f6b8e0 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13089
diff changeset
  6876
            outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6877
            command := eachConversionCommand 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6878
                            bindWith:(inFile pathName)
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6879
                            with:(outFile pathName).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6880
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6881
            errOutput := String writeStream.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6882
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6883
            (OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6884
                errMsg := resources
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6885
                            stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' 
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6886
                            with:inFile baseName allBold
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6887
                            with:eachConversionSuffix
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6888
                            with:eachConversionCommand allBold
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6889
                            with:errOutput contents.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6890
                exceptionBlock value:errMsg.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6891
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6892
                (inFile ~= fileName) ifTrue:[inFile remove].
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6893
                outFile remove.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6894
                ^ false
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6895
            ].
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6896
            (inFile ~= fileName) ifTrue:[inFile remove].
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6897
            inFile := outFile.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6898
            eachConversionSuffixCommandPair := conversionStream next
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6899
        ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6900
        outFile moveTo:(fileName withSuffix:(chainOfConversions last value)).
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6901
    ] ifCurtailed:[
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6902
        (inFile ~= fileName) ifTrue:[inFile remove].
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  6903
        outFile remove.
9493
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6904
    ].
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6905
    ^ true.
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6906
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6907
    "Created: / 20-05-2010 / 11:05:50 / cg"
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6908
!
3fc4fb8c1b0a changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents: 9490
diff changeset
  6909
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6910
createProjectAndOpenProjectBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  6911
    |nm f s directory|
321c1729db5b initial checkin
penk
parents:
diff changeset
  6912
321c1729db5b initial checkin
penk
parents:
diff changeset
  6913
    self currentFilesAreInSameDirectory ifFalse:[^ self].
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  6914
    directory := self currentDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6915
    nm := directory baseName.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6916
    f := (directory  construct:nm) withSuffix:'prj'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6917
    f exists ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6918
        Dialog warn:'A file named ' , f baseName , ' already exists.'.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  6919
        ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  6920
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  6921
    s := f writeStream.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6922
    s nextPutAll:'
321c1729db5b initial checkin
penk
parents:
diff changeset
  6923
name            ''' , nm , '''
321c1729db5b initial checkin
penk
parents:
diff changeset
  6924
type            #classLibrary
321c1729db5b initial checkin
penk
parents:
diff changeset
  6925
package         #''private:' , nm , '''
321c1729db5b initial checkin
penk
parents:
diff changeset
  6926
prerequisites   nil
321c1729db5b initial checkin
penk
parents:
diff changeset
  6927
321c1729db5b initial checkin
penk
parents:
diff changeset
  6928
classes      #( )
321c1729db5b initial checkin
penk
parents:
diff changeset
  6929
'.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6930
    s close.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6931
    ProjectBrowser openOnFile:f.
321c1729db5b initial checkin
penk
parents:
diff changeset
  6932
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  6933
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6934
doExecuteCommand
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6935
    "execute an OperatingSystem-command"
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6936
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6937
    | action fileName|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6938
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6939
    fileName := self firstSelectedFile.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6940
    action := [:command | 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6941
                self addToCommandHistory:command for:fileName.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6942
                self executeCommand:command.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6943
              ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6944
    self askForCommandFor:fileName thenDo:action
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6945
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6946
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6947
doExecuteScript
16941
9edb5cb2922f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16911
diff changeset
  6948
    "execute a Smalltalk script"
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6949
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6950
    |textHolder dialog template dummyClass dummyInstance|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6951
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6952
    template :=
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6953
'"/ Smalltalk script:
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6954
16084
mawalch
parents: 15981
diff changeset
  6955
"/ the following variables are accessible:
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6956
"/      directory       (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ')
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6957
"/      selectedFiles   (= ...)
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6958
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6959
"/ Beginner warning: Smalltalk know-how is useful here ;-).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6960
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6961
"/ Useful operations are:
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6962
"/      directory directoryContentsDo:[:eachBaseNameString | ...]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6963
"/      directory directoryContentsAsFilenamesDo:[:eachFilename | ...]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6964
"/      directory directory
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6965
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6966
"/ example: move all files which match a aarticular pattern to
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6967
"/          a separate directory:
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6968
"/ 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6969
"/        |directory idx prefix rest newDir oldFile newFile|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6970
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6971
"/        directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6972
"/
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6973
"/        directory directoryContentsDo:[:eachBaseNameString |
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6974
"/            (eachBaseNameString includes:$_) ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6975
"/                idx := eachBaseNameString indexOf:$_.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6976
"/                prefix := eachBaseNameString copyTo:(idx - 1).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6977
"/                rest := eachBaseNameString copyFrom:(idx + 1).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6978
"/                newDir := directory construct:prefix.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6979
"/                newDir exists ifFalse:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6980
"/                    (Dialog confirm:''Create '' , newDir pathName) ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6981
"/                        newDir makeDirectory.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6982
"/                    ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6983
"/                ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6984
"/                newDir exists ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6985
"/                    oldFile := directory construct:eachBaseNameString.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6986
"/                    newFile := newDir construct:rest.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6987
"/                    oldFile moveTo:newFile
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6988
"/                ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6989
"/            ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6990
"/        ]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6991
'.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6992
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6993
    LastScriptBlockString isNil ifTrue:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6994
        LastScriptBlockString := template.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6995
    ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6996
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6997
    textHolder := ValueHolder new.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6998
    dialog := Dialog 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  6999
                 forRequestText:(resources string:'Enter script')
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7000
                 editViewClass:CodeView
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7001
                 lines:25 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7002
                 columns:70
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7003
                 initialAnswer:LastScriptBlockString
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7004
                 model:textHolder.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7005
    dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7006
    dialog open.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7007
    dialog accepted ifFalse:[^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7008
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7009
    LastScriptBlockString := textHolder value.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7010
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7011
    Class classConventionViolationConfirmationQuerySignal 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7012
        answer:true
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7013
        do:[
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7014
            dummyClass := Object class
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7015
                    name:#Dummy
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7016
                    inEnvironment:nil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7017
                    subclassOf:Object
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7018
                    instanceVariableNames:'directory selectedFiles'
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7019
                    variable:false
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7020
                    words:true
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7021
                    pointers:true
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7022
                    classVariableNames:''
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7023
                    poolDictionaries:''
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7024
                    category:#dummyCategory
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7025
                    comment:nil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7026
                    changed:true.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7027
        ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7028
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7029
    dummyInstance := dummyClass basicNew.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7030
    dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7031
    dummyInstance instVarAt:2 put:(self currentSelectedFiles value).
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7032
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7033
    Compiler
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7034
        evaluate:textHolder value
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7035
        in:nil 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7036
        receiver:dummyInstance 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7037
        notifying:nil 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7038
        logged:false
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7039
        ifFail:[]
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7040
        compile:true.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7041
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7042
"/    fileName := self firstSelectedFile.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7043
"/    action := [:command | 
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7044
"/                self addToCommandHistory:command for:fileName.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7045
"/                self executeCommand:command.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7046
"/              ].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7047
"/    self askForCommandFor:fileName thenDo:action
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7048
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  7049
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  7050
doMake
7938
e8725dda1df6 make action for windows...
Claus Gittinger <cg@exept.de>
parents: 7900
diff changeset
  7051
    |dir cmd|
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  7052
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7053
    cmd := self makeCommandHolder value.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7054
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7055
    "Make"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7056
    cmd = 'make' ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7057
        dir := self theSingleSelectedDirectoryOrNil.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7058
        OperatingSystem isMSWINDOWSlike ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7059
            dir notNil ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7060
                (dir construct:'bmake.bat') exists ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7061
                    cmd := 'bmake.bat'.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7062
                ]
7938
e8725dda1df6 make action for windows...
Claus Gittinger <cg@exept.de>
parents: 7900
diff changeset
  7063
            ]
13856
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7064
        ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7065
        self executeCommand:cmd.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7066
        ^self.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7067
    ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7068
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7069
    "Apache ant"
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7070
    cmd = 'ant' ifTrue:[
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7071
        self executeCommand:cmd.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7072
        ^self.
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7073
    ].
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7074
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7075
    "Add more here..."
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7076
9e56b70c61da merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13783
diff changeset
  7077
    "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
  7078
!
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  7079
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  7080
doOpenCBrowser
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  7081
    "the CBrowser is an eXept-internal C-language IDE tool.
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  7082
     (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
  7083
     20 years ago ;-)"
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  7084
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  7085
    |destDir|
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  7086
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7087
    ((Smalltalk at:#'CBrowser') isNil or:[ (Smalltalk at:#'CBrowser::Browser') isNil ]) ifTrue:[
10747
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  7088
        Smalltalk loadPackage:'exept:CC'
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  7089
    ].
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  7090
    destDir := self currentDirectory.
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7091
    (Smalltalk at:#'CBrowser::Browser') openIn:destDir pathName
10747
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  7092
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  7093
    "Modified: / 04-10-2011 / 13:41:31 / cg"
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  7094
    "Modified (comment): / 27-07-2012 / 20:41:40 / cg"
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7095
    "Modified: / 26-09-2018 / 12:37:34 / Claus Gittinger"
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  7096
!
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  7097
7829
0e3be44e2f01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7788
diff changeset
  7098
doOpenExplorer
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7099
    "corresponding menu item is visible on a windows machine only"
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7100
11642
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7101
    self currentDirectory asFilename openExplorer
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7102
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7103
    "Modified: / 21-07-2012 / 12:28:36 / cg"
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7104
    "Modified (comment): / 26-09-2018 / 12:38:08 / Claus Gittinger"
7829
0e3be44e2f01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7788
diff changeset
  7105
!
0e3be44e2f01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7788
diff changeset
  7106
12473
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  7107
doOpenFinder
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7108
    "corresponding menu item is visible on a mac only"
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7109
    
12473
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  7110
    self currentDirectory asFilename openFinder
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  7111
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  7112
    "Modified: / 21-07-2012 / 12:28:36 / cg"
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7113
    "Modified (comment): / 26-09-2018 / 12:38:00 / Claus Gittinger"
12473
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  7114
!
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  7115
18432
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7116
doOpenGDBApplication
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7117
    "the GDBApplication is a cg-private debugging tool"
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7118
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7119
    |destDir|
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7120
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7121
    (Smalltalk at:#'GDBApplication') isNil ifTrue:[
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7122
        Smalltalk loadPackage:'cg:tools'
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7123
    ].
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7124
    destDir := self currentDirectory.
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7125
    (Smalltalk at:#'GDBApplication') openOn:destDir
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7126
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7127
    "Created: / 26-09-2018 / 12:09:32 / Claus Gittinger"
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7128
!
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  7129
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7130
doOpenMonticelloBrowser
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7131
    (Smalltalk at:#'MCMczReader') isNil ifTrue:[ 
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7132
        Smalltalk loadPackage:'stx:goodies/monticello'.
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7133
        (Smalltalk at:#'MCMczReader') isNil ifTrue:[
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7134
            Dialog warn:'Failed to load the monticello package'.
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7135
            ^ self.
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7136
        ].    
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7137
    ].
12874
f08360e7ac62 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 12871
diff changeset
  7138
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7139
    self withWaitCursorDo:[
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7140
        self currentSelectedFiles do:[:fn |
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7141
            |version snapshot|
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7142
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  7143
            (fn suffix sameAs:'mcz') ifTrue:[
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7144
                version := (Smalltalk at:#'MCMczReader') versionFromFile:fn.
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7145
                snapshot := version snapshot.
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7146
                (Tools::ChangeSetBrowser2 
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7147
                        on: snapshot asChangeSet
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7148
                        label: version info name)
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7149
                    beTwoColumn;
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7150
                    targetNamespace:nil;
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7151
                    targetPackage:nil;
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7152
                    open
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7153
                ]
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7154
        ]
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7155
    ]
18433
4afda005ed69 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18432
diff changeset
  7156
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  7157
    "Modified: / 01-05-2019 / 11:23:23 / Claus Gittinger"
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7158
!
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  7159
4317
bf3f150809c2 settings is a new application now and will be inserted under tools in
penk
parents: 4294
diff changeset
  7160
doOpenSettings
8168
04ed636784fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8127
diff changeset
  7161
    self openSettingsDialog
4317
bf3f150809c2 settings is a new application now and will be inserted under tools in
penk
parents: 4294
diff changeset
  7162
!
bf3f150809c2 settings is a new application now and will be inserted under tools in
penk
parents: 4294
diff changeset
  7163
9343
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7164
doOpenWithShellCommand
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7165
    "open using win32-shell"
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7166
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7167
    |fileName|
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7168
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7169
    fileName := self firstSelectedFile.
9405
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7170
    fileName notNil ifTrue:[    
11642
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7171
        OperatingSystem
9405
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7172
            openApplicationForDocument:fileName pathName 
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7173
            operation:#open
5b598565288a changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9393
diff changeset
  7174
    ]
11642
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7175
72cd5c5e2615 changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 11591
diff changeset
  7176
    "Modified: / 21-07-2012 / 12:26:10 / cg"
9343
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7177
!
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  7178
7104
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7179
editMode:aSymbol
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7180
    self 
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7181
        applicationNamed:#FileApplicationNoteBook
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7182
        ifPresentDo:[:appl |
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7183
            |subApp|
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7184
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7185
            subApp := appl selectedApplication.
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7186
            subApp notNil ifTrue:[
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7187
                ^ subApp perform:aSymbol
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7188
            ]
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7189
        ].
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7190
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7191
    "Created: / 11-09-2006 / 12:42:08 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7192
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7193
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7194
editModeInsert
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7195
    self editMode:#editModeInsert
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7196
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7197
    "Created: / 11-09-2006 / 12:40:36 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7198
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7199
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7200
editModeInsertAndSelect
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7201
    self editMode:#editModeInsertAndSelect
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7202
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7203
    "Created: / 11-09-2006 / 12:40:45 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7204
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7205
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7206
editModeOverwrite
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7207
    self editMode:#editModeOverwrite
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7208
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7209
    "Modified: / 11-09-2006 / 12:42:26 / cg"
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7210
!
a92ba997a778 edit mode menu
Claus Gittinger <cg@exept.de>
parents: 7078
diff changeset
  7211
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7212
fetchFileByURL
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7213
    |url destinationFilename|
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7214
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  7215
    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
  7216
    url isEmptyOrNil ifTrue:[^ self].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7217
    url := url asURL.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7218
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  7219
    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
  7220
    destinationFilename isEmptyOrNil ifTrue:[^ self].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7221
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7222
    destinationFilename := self currentDirectory asFilename / destinationFilename.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7223
    destinationFilename exists ifTrue:[
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7224
        |answer|
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7225
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7226
        answer := Dialog 
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7227
            confirm:(resources string:'Overwrite existing %1 ?' with:destinationFilename baseName allBold)
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7228
            default:false.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7229
        answer ~~ true ifTrue:[^ self].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7230
    ].
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7231
    self withActivityIndicationDo:[
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7232
        self notify:(resources string:'Fetching %1' with:url).
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7233
        HTTPInterface get:url destinationFile:destinationFilename.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7234
        self notify:nil.
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7235
    ]
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7236
17818
045764df016c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17790
diff changeset
  7237
    "Modified: / 29-11-2017 / 12:26:13 / cg"
15528
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7238
!
a9986f82fdfb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15507
diff changeset
  7239
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7240
fileContentsAsByteArray
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7241
    |file fileSize|
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7242
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7243
    file := self firstSelectedFile.
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7244
    file isNil ifTrue:[^ self ].
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7245
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7246
    file := file asFilename.
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7247
    
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7248
    (fileSize := file fileSize) > (1024*1024) ifTrue:[
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7249
        fileSize > (128*1024*1024) ifTrue:[
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7250
            Dialog warn:(resources string:'File is too big').
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7251
            ^ self.
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7252
        ].
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7253
        (Dialog confirm:(resources 
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7254
                            string:'File is big (%1) - proceed?' 
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7255
                            with:(UnitConverter fileSizeStringFor:fileSize))
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7256
        ) ifFalse:[^ self].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7257
    ].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7258
    file binaryContentsOfEntireFile inspect
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7259
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  7260
    "Modified: / 19-11-2017 / 14:58:43 / cg"
8454
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7261
!
15917af80ff6 changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents: 8440
diff changeset
  7262
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7263
fileFileIn
321c1729db5b initial checkin
penk
parents:
diff changeset
  7264
    "fileIn the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7265
321c1729db5b initial checkin
penk
parents:
diff changeset
  7266
    self fileFileInLazy:false 
321c1729db5b initial checkin
penk
parents:
diff changeset
  7267
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7268
7324
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7269
fileFileIn:aFilename lazy:lazy
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7270
    "fileIn a file"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7271
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7272
    self withActivityIndicationDo:[
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7273
        self notify:('File in:', aFilename asFilename baseName).
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7274
        self singleFileFileIn:aFilename lazy:lazy.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7275
        self notify:nil.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7276
    ]
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7277
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7278
    "Created: / 20-09-2006 / 14:28:35 / cg"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7279
!
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7280
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7281
fileFileInLazy
321c1729db5b initial checkin
penk
parents:
diff changeset
  7282
    "fileIn the selected file(s). Do a quick load (no compilation)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7283
321c1729db5b initial checkin
penk
parents:
diff changeset
  7284
    self fileFileInLazy:true 
321c1729db5b initial checkin
penk
parents:
diff changeset
  7285
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7286
321c1729db5b initial checkin
penk
parents:
diff changeset
  7287
fileFileInLazy:lazy
321c1729db5b initial checkin
penk
parents:
diff changeset
  7288
    "fileIn the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7289
7324
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7290
    self currentSelectedFiles do:[:fileName |
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7291
        self fileIn:fileName lazy:lazy
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7292
    ].
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7293
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7294
    "Modified: / 20-09-2006 / 14:29:24 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7295
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7296
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7297
fileFileInPackage
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7298
    "assuming the current directory is a package directory, load it"
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7299
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7300
    |packageDir dir path top packageID|
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7301
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7302
    "/ find a reasonable package-id (walk up until we find stx)
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7303
    path := ''.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7304
    dir := packageDir := self currentDirectory.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7305
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7306
    top := (Smalltalk projectDirectoryForPackage:'stx') asFilename.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7307
    [ (dir / 'stx') = top ] whileFalse:[
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7308
        path := dir baseName , '/' , path.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7309
        dir := dir directory.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7310
        dir isNil ifTrue:[
12707
6e9276c4fc95 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 12684
diff changeset
  7311
            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
  7312
            "/ should ask the user for a packageID and proceed...
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7313
            ^  self.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7314
        ].
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7315
    ].
12707
6e9276c4fc95 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 12684
diff changeset
  7316
    packageID := path copyButLast:1.
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7317
    Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7318
!
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  7319
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7320
fileFileInToNameSpace
321c1729db5b initial checkin
penk
parents:
diff changeset
  7321
    "fileIn the selected file(s)<into a nameSpace"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7322
321c1729db5b initial checkin
penk
parents:
diff changeset
  7323
    |ns listOfKnownNameSpaces|
321c1729db5b initial checkin
penk
parents:
diff changeset
  7324
321c1729db5b initial checkin
penk
parents:
diff changeset
  7325
    listOfKnownNameSpaces := Set new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7326
    NameSpace 
6672
478b83a3753a max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents: 6671
diff changeset
  7327
        allNameSpaces 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7328
            do:[:eachNameSpace | 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7329
                listOfKnownNameSpaces add:eachNameSpace name
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7330
            ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7331
    listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7332
321c1729db5b initial checkin
penk
parents:
diff changeset
  7333
    ns := Dialog 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7334
                request:'During fileIn, new classes are created in nameSpace:'
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7335
                initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7336
                list:listOfKnownNameSpaces.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7337
    ns isEmptyOrNil ifTrue:[^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  7338
321c1729db5b initial checkin
penk
parents:
diff changeset
  7339
    LastEnforcedNameSpace := ns.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7340
    ns := NameSpace name:ns.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7341
321c1729db5b initial checkin
penk
parents:
diff changeset
  7342
    Class nameSpaceQuerySignal 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7343
        answer:ns
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7344
        do:[ 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7345
            self fileFileInLazy:false 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7346
        ] 
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7347
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7348
321c1729db5b initial checkin
penk
parents:
diff changeset
  7349
fileFindAllDuplicates
321c1729db5b initial checkin
penk
parents:
diff changeset
  7350
    "scan directory and all subdirs for duplicate files"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7351
321c1729db5b initial checkin
penk
parents:
diff changeset
  7352
    |fileNames dir infoDir filesBySize
321c1729db5b initial checkin
penk
parents:
diff changeset
  7353
     result info dirPrefix myName stream textBox maxLength directories|
321c1729db5b initial checkin
penk
parents:
diff changeset
  7354
321c1729db5b initial checkin
penk
parents:
diff changeset
  7355
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  7356
    self withActivityIndicationDo:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7357
        result := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7358
        myName := self class name asString.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7359
        directories := self currentSelectedDirectories.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7360
        directories isEmpty ifTrue:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7361
        
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7362
        dir := directories first.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7363
"/        self label: myName, '- gathering file names ...'.
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7364
        [
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7365
            fileNames := dir recursiveDirectoryContents.
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7366
        ] on:FileStream openErrorSignal do:[:ex|
6352
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7367
            self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' 
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7368
                            with:ex pathName
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7369
                            with:ex description).
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7370
            ^ self
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  7371
        ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  7372
        fileNames := fileNames 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  7373
                        collect:[:fn | dir construct:fn]
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  7374
                        thenSelect:[:fn | fn isRegularFile].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7375
321c1729db5b initial checkin
penk
parents:
diff changeset
  7376
"/        self label:myName , '- gathering sizes ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7377
        infoDir := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7378
        fileNames do:[:fn |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7379
            infoDir at:fn put:(fn fileSize)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7380
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7381
14497
6d95f7c8d28e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14419
diff changeset
  7382
        "/ for each, get the file's size.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7383
        "/ 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
  7384
        "/ compare them ...
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7385
321c1729db5b initial checkin
penk
parents:
diff changeset
  7386
"/        self label:myName , '- preselect possible duplicates ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7387
        filesBySize := Dictionary new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7388
        infoDir keysAndValuesDo:[:fn :sz |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7389
            |entry|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7390
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7391
            entry := filesBySize at:sz ifAbsentPut:[Set new].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7392
            entry add:fn.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7393
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7394
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7395
        "/ any of same size ?
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7396
321c1729db5b initial checkin
penk
parents:
diff changeset
  7397
"/        self label:myName , '- checking for duplicates ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7398
        filesBySize do:[:entry |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7399
            |files|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7400
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7401
            entry size > 1 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7402
                files := entry asArray.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7403
                1 to:files size-1 do:[:idx1 |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7404
                    idx1+1 to:files size do:[:idx2 |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7405
                        |fn1 fn2|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7406
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7407
                        fn1 := files at:idx1.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7408
                        fn2 := files at:idx2.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7409
321c1729db5b initial checkin
penk
parents:
diff changeset
  7410
"/                        self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7411
                        (result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7412
                            "/ compare the files
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7413
                            (fn1 sameContentsAs:fn2) ifTrue:[
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7414
"/                                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
  7415
                                result at:fn1 put:fn2.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7416
                            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7417
                        ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7418
                    ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7419
                ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7420
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7421
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7422
321c1729db5b initial checkin
penk
parents:
diff changeset
  7423
"/        self label:myName , '- sorting ...'.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7424
        dirPrefix := dir pathName.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7425
        result := result associations.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7426
        result := result collect:[:assoc |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7427
                                        |f1 f2|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7428
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7429
                                        f1 := assoc key name.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7430
                                        f2 := assoc value name.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7431
                                        (f1 startsWith:dirPrefix) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7432
                                            f1 := f1 copyFrom:dirPrefix size + 2.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7433
                                        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7434
                                        (f2 startsWith:dirPrefix) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7435
                                            f2 := f2 copyFrom:dirPrefix size + 2.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7436
                                        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7437
                                        f1 < f2 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7438
                                            f2 -> f1
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7439
                                        ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7440
                                            f1 -> f2
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7441
                                        ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7442
                                ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7443
        result sort:[:f1 :f2 | f2 value < f1 value].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7444
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7445
        info := OrderedCollection new.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7446
        result do:[:assoc |
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7447
            info add:(assoc key , ' same as ' , assoc value)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7448
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7449
        info isEmpty ifTrue:[
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7450
            Dialog information:(resources string:'No duplicate files found.').
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  7451
            ^ self.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7452
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7453
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  7454
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7455
    stream := CharacterWriteStream new.
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7456
    stream nextPutAllLines:info.
5542
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7457
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7458
    textBox := TextBox new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7459
    textBox initialText:(stream contents).
5542
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7460
    stream close.
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7461
    textBox title:(resources string:'File duplicates in directory: %1' with:dir asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7462
    textBox readOnly:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7463
    textBox noCancel.
11889
f97fbd89d7c7 changed:
Claus Gittinger <cg@exept.de>
parents: 11783
diff changeset
  7464
    textBox label:(resources string:'Duplicates in %1' with:dir asString).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7465
    maxLength := 10.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7466
    info do:[: el |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  7467
        maxLength := maxLength max:(el size).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7468
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  7469
    textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false.
5542
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7470
    textBox maxExtent:Screen current extent.
d6a34a556472 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5535
diff changeset
  7471
    textBox openModeless.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  7472
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7473
    "Modified: / 27-07-2012 / 09:29:00 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7474
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7475
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7476
fileFindDuplicateFile
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7477
    "scan directory for duplicates of the selected files"
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7478
10306
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7479
    |files filesBySize samePerFile stream textBox mustHaveMatches|
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7480
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7481
    files := self currentSelectedFiles.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7482
    files isEmpty ifTrue:[^ self].
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7483
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7484
    self withWaitCursorDo:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7485
        filesBySize := Dictionary new.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7486
        files do:[:fn |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7487
            |sz entry|
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7488
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7489
            sz := fn asFilename fileSize.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7490
            (filesBySize at:sz ifAbsentPut:[Set new]) add:fn.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7491
        ].
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7492
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7493
        samePerFile := Dictionary new.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7494
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7495
        self currentSelectedDirectories do:[:eachDir |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7496
            eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile |
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  7497
                eachFile isRegularFile ifTrue:[
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7498
                    |sz possibleMatches|
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7499
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7500
                    sz := eachFile fileSize.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7501
                    possibleMatches := filesBySize at:sz ifAbsent:nil.
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7502
                    possibleMatches notNil ifTrue:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7503
                        possibleMatches do:[:eachFileWithSameSize |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7504
                            eachFileWithSameSize ~= eachFile ifTrue:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7505
                                (eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7506
                                    (samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7507
                                ]
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7508
                            ]
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7509
                        ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7510
                    ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7511
                ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7512
            ]
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7513
        ].
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7514
    ].
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7515
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7516
    stream := CharacterWriteStream with:'Duplicates:'.
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7517
    (samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName])
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7518
    do:[:origFile |
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7519
        |sameFiles|
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7520
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
  7521
        sameFiles :=  samePerFile at:origFile.
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7522
        stream nextPutLine:origFile baseName.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7523
        (sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName |
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7524
            stream nextPutAll:'    '; nextPutLine:eachSameName.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7525
        ]
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7526
    ].
10306
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7527
    stream nextPutLine:'Files without duplicates:'.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7528
    (samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName])
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7529
    do:[:origFile |
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7530
        |sameFiles|
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7531
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7532
        sameFiles :=  samePerFile at:origFile.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7533
        sameFiles isEmpty ifTrue:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7534
            stream nextPutLine:origFile baseName.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7535
        ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7536
    ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7537
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7538
    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
  7539
    mustHaveMatches notEmptyOrNil ifTrue:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7540
        LastMustMatchPattern := mustHaveMatches.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7541
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7542
        stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7543
        (samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName])
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7544
        do:[:origFile |
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7545
            |sameFiles|
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7546
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7547
            sameFiles :=  samePerFile at:origFile.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7548
            sameFiles notEmpty ifTrue:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7549
                (sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7550
                    stream nextPutLine:origFile baseName.
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7551
                ]
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7552
            ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7553
        ].
daa2548f71ca class definition
Claus Gittinger <cg@exept.de>
parents: 10305
diff changeset
  7554
    ].
10304
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7555
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7556
    textBox := TextBox new.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7557
    textBox initialText:(stream contents).
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7558
    textBox title:'Files with same contents'.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7559
    textBox readOnly:true.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7560
    textBox noCancel.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7561
    textBox extent:(350@400).
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7562
    textBox maxExtent:Screen current extent.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7563
    textBox openModeless. "/ showAtPointer.
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7564
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7565
    "Created: / 11-07-2011 / 12:39:44 / cg"
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7566
!
ef51c640ee76 added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10258
diff changeset
  7567
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7568
fileFindDuplicates
321c1729db5b initial checkin
penk
parents:
diff changeset
  7569
    "scan directory for duplicate files"
321c1729db5b initial checkin
penk
parents:
diff changeset
  7570
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7571
    |directories duplicates info 
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7572
     commonDir prefixSize stream titleStream textBox maxLength|
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7573
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7574
    directories := self currentSelectedDirectories.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7575
    duplicates := self class fileFindDuplicatesIn:directories.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7576
    duplicates isEmpty ifTrue:[
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7577
        Dialog information:'No duplicate files found.'.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7578
        ^ self.
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7579
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7580
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7581
    info := OrderedCollection new.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7582
    commonDir := self getBestDirectory.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7583
    prefixSize := commonDir asString size.
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7584
    duplicates do:[:assoc |
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7585
        |dup orig|
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7586
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7587
        dup := assoc key.
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7588
        orig := assoc value.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7589
        prefixSize > 1 ifTrue:[
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7590
            dup := dup pathNameRelativeFrom:commonDir.
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7591
            orig := orig pathNameRelativeFrom:commonDir.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7592
            "/ fn1 := ('..', (fn1 name copyFrom:(prefixSize + 1))).
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7593
            "/ fn2 := ('..', (fn2 copyFrom:(prefixSize + 1))).
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7594
        ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7595
        (dup includes:Character space) ifTrue:[
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7596
            dup := '"' , dup , '"'
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7597
        ].
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7598
        (orig includes:Character space) ifTrue:[
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7599
            orig := '"' , orig , '"'
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7600
        ].
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7601
        info add:(dup , ' duplicate of ' , orig)
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7602
    ].
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7603
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7604
    stream := CharacterWriteStream new.
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7605
    stream nextPutAllLines:info.
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7606
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7607
    titleStream := CharacterWriteStream with:'File duplicates in director'.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7608
    directories size == 1 ifTrue:[
12602
a3610dbd8b96 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12497
diff changeset
  7609
        titleStream nextPutAll:'y: '; nextPutAll: directories first asString.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7610
    ] ifFalse:[
4535
4df3f171bcb0 *** empty log message ***
penk
parents: 4534
diff changeset
  7611
        titleStream nextPutLine:'ies: '.
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7612
        directories do:[:dir|
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7613
            prefixSize > 1 ifTrue:[
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7614
                titleStream nextPutAll:'..'.
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  7615
                titleStream nextPutLine:((dir asString) copyFrom:(prefixSize + 1)).
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7616
            ] ifFalse:[
4535
4df3f171bcb0 *** empty log message ***
penk
parents: 4534
diff changeset
  7617
                titleStream nextPutLine:(dir asString).
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7618
            ].
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7619
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7620
    ].
5543
574360e0f2ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5542
diff changeset
  7621
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7622
    textBox := TextBox new.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7623
    textBox initialText:(stream contents).
321c1729db5b initial checkin
penk
parents:
diff changeset
  7624
    textBox title:(titleStream contents).
321c1729db5b initial checkin
penk
parents:
diff changeset
  7625
    textBox readOnly:true.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7626
    textBox noCancel.
14715
e806729125fc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14709
diff changeset
  7627
    stream := WriteStream on:''.
e806729125fc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14709
diff changeset
  7628
    stream nextPutAll:'Duplicates in '.
4170
d01b3e418209 *** empty log message ***
penk
parents: 4164
diff changeset
  7629
    directories do:[ :aDirectory |
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7630
        stream nextPutAll:aDirectory baseName.
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7631
        stream space.
4050
d63d33ad9c41 *** empty log message ***
penk
parents: 4046
diff changeset
  7632
    ].
4170
d01b3e418209 *** empty log message ***
penk
parents: 4164
diff changeset
  7633
    textBox label:stream contents.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7634
    maxLength := 10.
321c1729db5b initial checkin
penk
parents:
diff changeset
  7635
    info do:[: el |
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7636
        maxLength := maxLength max:(el size).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7637
    ].
5092
1f44028f8fb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5082
diff changeset
  7638
    textBox extent:((maxLength * 5)@((info size max:40)* 10)).
1f44028f8fb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5082
diff changeset
  7639
    textBox maxExtent:Screen current extent.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7640
    textBox addButton:(Button 
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7641
                        label:(resources string:'Remove Duplicates')
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7642
                        action:[
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7643
                            (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
  7644
                                duplicates do:[:eachAssoc |
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7645
                                    eachAssoc key remove
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7646
                                ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7647
                            ].
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7648
                            textBox close.
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  7649
                            self updateCurrentDirectoryWithReread.
17869
4f02f7359cd2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17868
diff changeset
  7650
                        ]).
4355
63dc8ed2e56c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  7651
    textBox openModeless. "/ showAtPointer.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  7652
11688
0a519d63778c withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 11642
diff changeset
  7653
    "Modified: / 27-07-2012 / 09:29:14 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7654
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7655
321c1729db5b initial checkin
penk
parents:
diff changeset
  7656
fileFindFile
5961
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7657
    |filename|
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7658
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7659
    filename := self firstSelectedFileName.
f91c25cf2475 private classes are private
Claus Gittinger <cg@exept.de>
parents: 5960
diff changeset
  7660
    filename isNil ifTrue:[
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  7661
        filename := Filename homeDirectory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7662
    ].
4101
cc9cdc23b789 select & doubleClick
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  7663
    FindFileApplication openOnFileName:filename for:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  7664
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  7665
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7666
fileFindSimilarImages
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7667
    "scan directory for similar image files"
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7668
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7669
    |result stream textBox directories imageFiles histogramsV histogramsH 
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7670
     similarV similarH similar alreadyPrinted|
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7671
8524
cac6b19eae23 changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents: 8512
diff changeset
  7672
self withWaitCursorDo:[
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7673
    self withActivityIndicationDo:[
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7674
        result := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7675
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7676
        directories := self currentSelectedDirectories.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7677
        directories isEmpty ifTrue:[^ self].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7678
13714
d5583c9b5ddb class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13704
diff changeset
  7679
        imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImageType].
8511
641332126a4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8510
diff changeset
  7680
        "/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo'].
641332126a4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8510
diff changeset
  7681
        imageFiles sort:[:a :b | a pathName < b pathName].
641332126a4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8510
diff changeset
  7682
        
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7683
        "/ for each, get the color histogram
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7684
        histogramsV := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7685
        histogramsH := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7686
        imageFiles do:[:fn |
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7687
            |hist image|
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7688
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7689
            image := Image fromFile:fn.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7690
            Transcript showCR:'generating histogram for ',fn baseName.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7691
            hist := ImageColorHistogram new forImage:image.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7692
            histogramsV at:fn put:(hist histogramVectorV).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7693
            histogramsH at:fn put:(hist histogramVectorH).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7694
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7695
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7696
        similarH := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7697
        similarV := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7698
        similar := Dictionary new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7699
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7700
        (self firstSelectedFile notNil
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7701
            ifTrue:[ Array with:self firstSelectedFile ]
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7702
            ifFalse:[ imageFiles ])
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7703
        do:[:eachFile1 |
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7704
            |setOfSimilar distancesV distancesH|
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7705
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7706
            distancesV := OrderedCollection new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7707
            distancesH := OrderedCollection new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7708
            setOfSimilar := OrderedCollection new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7709
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7710
            imageFiles do:[:eachFile2 |
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7711
                |v1 v2 dV dH|
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7712
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7713
                eachFile1 ~= eachFile2 ifTrue:[
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7714
                    v1 := histogramsV at:eachFile1.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7715
                    v2 := histogramsV at:eachFile2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7716
                    dV := ImageColorHistogram distanceFrom:v1 to:v2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7717
                    distancesV add:(eachFile2 -> dV).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7718
                    v1 := histogramsH at:eachFile1.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7719
                    v2 := histogramsH at:eachFile2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7720
                    dH := ImageColorHistogram distanceFrom:v1 to:v2.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7721
                    distancesH add:(eachFile2 -> dH).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7722
                    (dV < 10000 and:[dH < 10000]) ifTrue:[
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7723
                        setOfSimilar add:eachFile2->(dV + dH).
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7724
                    ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7725
                ]
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7726
            ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7727
            distancesV sort:[:a1 :a2 | a1 value < a2 value].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7728
            distancesH sort:[:a1 :a2 | a1 value < a2 value].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7729
            similarV at:eachFile1 put:distancesV.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7730
            similarH at:eachFile1 put:distancesH.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7731
            setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7732
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7733
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7734
        similar isEmpty ifTrue:[
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7735
            Dialog information:'No similarities found.'.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7736
            ^ self.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7737
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7738
    ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7739
15589
d7db0a09d972 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 15569
diff changeset
  7740
    stream := CharacterWriteStream new.
8512
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7741
    alreadyPrinted := Set new.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7742
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7743
    imageFiles do:[:eachFile |
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7744
        |eachSet|
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7745
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7746
        (alreadyPrinted includes:eachFile) ifFalse:[
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7747
            eachSet := similar at:eachFile ifAbsent:nil.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7748
            eachSet notNil ifTrue:[
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7749
                stream nextPutLine:eachFile pathName.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7750
                eachSet do:[:info |
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7751
                    |fn2 dist|
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7752
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7753
                    fn2 := info key.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7754
                    dist := info value.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7755
                    stream nextPutAll:'    '.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7756
                    stream nextPutAll:fn2 pathName.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7757
                    stream nextPutLine:' (',dist printString,')'.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7758
                    alreadyPrinted add:fn2.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7759
                ].
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7760
                stream cr.
60c663ba731f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8511
diff changeset
  7761
            ].
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7762
        ].
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7763
    ].
8524
cac6b19eae23 changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents: 8512
diff changeset
  7764
    ].
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7765
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7766
    textBox := TextBox new.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7767
    textBox initialText:(stream contents).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7768
    textBox title:'File similarities:'.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7769
    textBox readOnly:true.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7770
    textBox noCancel.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7771
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7772
    textBox label:'File similarities'.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7773
    textBox extent:(400@((similar size max:40)* 10)).
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7774
    textBox maxExtent:Screen current extent.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7775
    textBox openModeless. "/ showAtPointer.
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7776
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7777
    "Modified: / 25-07-2006 / 09:07:25 / cg"
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7778
!
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  7779
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7780
fileHexDump
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  7781
    |file item|
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7782
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7783
    file := self firstSelectedFile.
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7784
    file notNil ifTrue:[
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7785
        item := DirectoryContentsBrowser itemClass fileName:file.
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  7786
        self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  7787
            applicationNamed:#FileApplicationNoteBook
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  7788
            ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item].
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7789
    ].
17744
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  7790
8ce1acaa8fee #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17724
diff changeset
  7791
    "Modified (format): / 12-11-2017 / 11:19:56 / cg"
4618
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7792
!
fa8474922061 hexDump from tools menu implemented
penk
parents: 4614
diff changeset
  7793
7324
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7794
fileIn:aFilename
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7795
    "fileIn a file"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7796
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7797
    self fileIn:aFilename lazy:false
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7798
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7799
    "Created: / 20-09-2006 / 14:30:06 / cg"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7800
!
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7801
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7802
fileIn:aFilename lazy:lazy
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7803
    "fileIn a file"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7804
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7805
    self withActivityIndicationDo:[
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7806
        self notify:('File in:', aFilename asFilename baseName).
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7807
        self singleFileFileIn:aFilename lazy:lazy.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7808
        self notify:nil.
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7809
    ]
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7810
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7811
    "Created: / 20-09-2006 / 14:29:21 / cg"
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7812
!
e0a07ea40af9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7315
diff changeset
  7813
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7814
filterSelectedFiles:whichFilter
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7815
    |selectedFiles numFiles msg filterBlock|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7816
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  7817
    selectedFiles := self currentSelectedObjects.
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7818
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7819
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7820
    msg := 'Replace contents of file ''%2'' with output of %3-filter ?'.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7821
    numFiles > 1 ifTrue:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7822
        msg := 'Replace contents of %1 files with output of %3-filter ?'.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7823
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7824
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7825
    (Dialog 
6352
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  7826
        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
  7827
        initialAnswer:false
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7828
    ) ifFalse:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7829
        ^ self
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7830
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7831
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7832
    whichFilter == #rot13 ifTrue:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7833
        filterBlock := [:charIn | charIn rot13 ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7834
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7835
    "/ add more here...
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7836
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7837
    filterBlock isNil ifTrue:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7838
        self information:'No such filter: ' , whichFilter.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7839
        ^ self.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7840
    ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7841
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7842
    selectedFiles do:[:fileName |
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7843
        |s|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7844
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7845
        self notify:('Processing:',  fileName baseName).
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  7846
        fileName isRegularFile ifTrue:[
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7847
            [
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7848
                |inFile outFile in out|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7849
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7850
                inFile := fileName asFilename.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7851
                outFile := (fileName pathName , '.filter') asFilename.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7852
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7853
                [
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7854
                    |charIn charOut|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7855
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7856
                    in := inFile readStream.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7857
                    out := outFile writeStream.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7858
                    [in atEnd] whileFalse:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7859
                        charIn := in next.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7860
                        charOut := filterBlock value:charIn.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7861
                        out nextPut:charOut.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7862
                    ].
13683
e31bd21c4760 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13677
diff changeset
  7863
                    out close. out:= nil.
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7864
                    outFile renameTo:inFile.
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7865
                ] ensure:[
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7866
                    out notNil ifTrue:[ out close ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7867
                    in notNil ifTrue:[ in close ].
18024
b033a880db74 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18013
diff changeset
  7868
                    outFile remove.
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7869
                ]
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7870
            ] on:FileStream openErrorSignal do:[:ex|
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7871
                self warn:('Cannot process "%1".' bindWith:fileName baseName allBold).
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7872
            ].
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7873
        ]
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7874
    ].
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  7875
    self notify:nil.
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  7876
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  7877
    "Modified: / 04-12-2006 / 13:14:48 / cg"
4930
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7878
!
a1d871f949af checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4922
diff changeset
  7879
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7880
forEachParsedXmlFileDo:aBlock
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7881
    "parse all selected XML files, for each dom-tree, evaluate aBlock"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7882
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7883
    self withActivityIndicationDo:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7884
        | selectedFiles xmlDocument |
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7885
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7886
        selectedFiles:= self currentSelectedFiles.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7887
        selectedFiles do:[:fileName |
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7888
            XML::XMLSignal handle:[:ex |
14551
0fc5b67cdd3e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14530
diff changeset
  7889
                Dialog 
0fc5b67cdd3e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14530
diff changeset
  7890
                    information:('Error while reading XML:\    %1' bindWith:ex description) withCRs
0fc5b67cdd3e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14530
diff changeset
  7891
                    title:'XML Error'.
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7892
                ^ self.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7893
            ] do:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7894
                |s d magic encoder document|
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7895
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7896
                s := fileName asFilename readStream.
14012
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7897
                [
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7898
                    s binary.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7899
                    magic := (s next:2).
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7900
                    magic = #[254 255] ifTrue:[
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7901
                        "/ UTF16BE
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7902
                        document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7903
                    ] ifFalse:[ 
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7904
                        magic = #[255 254] ifTrue:[
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7905
                            "/ UTF16LE
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7906
                            document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7907
                        ].
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7908
                    ]. 
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7909
                ] ensure:[
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7910
                    s close.
9d3ec63fe7d6 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13968
diff changeset
  7911
                ].
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7912
                document notNil ifTrue:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7913
                    xmlDocument := XML::XMLParser 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7914
                                    processDocumentString:document 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7915
                                    beforeScanDo:[:parse| parse validate:false].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7916
                ] ifFalse:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7917
                    xmlDocument := XML::XMLParser 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7918
                                    processDocumentInFilename:fileName 
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7919
                                    beforeScanDo:[:parse| parse validate:false].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7920
                ]
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7921
            ].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7922
            aBlock value:xmlDocument.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7923
        ].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7924
    ]
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7925
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7926
    "Created: / 17-02-2011 / 13:58:21 / cg"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7927
!
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  7928
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7929
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock 
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7930
    |numItems path files|
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7931
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7932
    files := self currentSelectedFiles.
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7933
    
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7934
    (numItems := files size) > 2 ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7935
        (self 
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7936
            confirm:(resources string:'Open for each of the %1 items ?' 
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7937
                                 with:numItems)) ifFalse:[^ self].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7938
    ].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7939
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7940
    self withActivityIndicationDo:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7941
        files do:[:fileName |
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7942
            (ignoreDirs not or:[fileName isDirectory not]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7943
                fileName isAbsolute ifTrue:[
17239
f09d9792751b #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17202
diff changeset
  7944
                    path := fileName name.
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7945
                ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7946
                    path := fileName pathName.
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7947
                ].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7948
                aBlock value:path
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7949
            ]
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7950
        ].
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7951
    ].
17239
f09d9792751b #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17202
diff changeset
  7952
f09d9792751b #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 17202
diff changeset
  7953
    "Modified: / 19-01-2017 / 16:57:03 / stefan"
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7954
!
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  7955
8648
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7956
generateDetachedSignaturesForSelectedFiles
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7957
    "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
  7958
     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
  7959
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7960
    self withActivityIndicationDo:[
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7961
        self currentSelectedFiles do:[:fn |
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7962
            |data hash signature signatureFile|
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7963
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7964
            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
  7965
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7966
            data := fn contentsAsString.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7967
            hash := SHA1Stream hashValueOf:data.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7968
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7969
            signature := Expecco::KeyFileGenerator new signExpeccoCode:hash.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7970
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7971
            signatureFile := fn addSuffix:'sig'.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7972
            signatureFile contents:signature.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7973
        ].
13677
1b97a31ac83f class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13521
diff changeset
  7974
        self updateCurrentDirectoryWithReread.
8648
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7975
        self notify:nil.
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7976
    ]
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7977
!
e8a98d146af2 Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents: 8646
diff changeset
  7978
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7979
generatePatchInstallerForSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7980
    "generate an expecco patch, which installs the selected file(s).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7981
     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
  7982
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7983
    |dialog targetDirHolder targetDir 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7984
     generateSignedPatchHolder patchFileNameHolder patchFileName|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7985
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7986
    targetDirHolder := '.' asValue.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7987
    generateSignedPatchHolder := true asValue.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7988
    patchFileNameHolder := '/tmp/00nn_patchFile.st' asValue.
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
    dialog := Dialog new.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7991
    dialog label:(resources string:'Patch Installer for File(s)').
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7992
    dialog addTextLabel:'Patchfile Name' adjust:#left.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7993
    dialog addInputFieldOn:patchFileNameHolder tabable:true.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7994
    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
  7995
    dialog addInputFieldOn:targetDirHolder tabable:true.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7996
    dialog addCheckBox:'Generate Signed Patch' on:generateSignedPatchHolder.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7997
    dialog addAbortAndOkButtons.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7998
    dialog open.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  7999
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8000
    dialog accepted ifFalse:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8001
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8002
    targetDir := targetDirHolder value asFilename.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8003
    patchFileName := patchFileNameHolder value asFilename.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8004
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8005
    self withActivityIndicationDo:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8006
        |outStream zipArchive pkcs7SignedData signatureFilename|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8007
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8008
        self notify:'Generating self extracting st script: ', patchFileName name, '...'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8009
        outStream := patchFileName writeStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8010
        outStream nextPutAll:'
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8011
|patchStream zipArchive|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8012
patchStream := Expecco::Browser::CurrentPatchStreamQuery query.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8013
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
  8014
zipArchive := ZipArchive readingFrom:patchStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8015
zipArchive members do:[:each | zipArchive extract:each fileName].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8016
patchStream setToEnd. "/ to force fileIn to finish
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8017
!!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8018
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8019
!! !!
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8020
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8021
'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8022
        zipArchive := ZipArchive writingTo:outStream. "/ newFileNamed:(patchFileName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8023
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8024
        self currentSelectedFiles do:[:fn |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8025
            |inStream signatureFilename|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8026
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8027
            inStream := fn asFilename readStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8028
            zipArchive addFile: (targetDir construct:fn asFilename baseName) name fromStream:inStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8029
            inStream close.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8030
        ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8031
16975
9c6630591fe6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 16941
diff changeset
  8032
        zipArchive close.
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8033
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8034
        generateSignedPatchHolder value ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8035
            self notify:'Generating signed file from: ', patchFileName name, '...'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8036
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8037
            pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:patchFileName contentsOfEntireFile.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8038
            signatureFilename := patchFileName withSuffix:'expeccoPatch'.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8039
            signatureFilename contents:pkcs7SignedData.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8040
        ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8041
        self notify:nil.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8042
    ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8043
!
13783
00625eec40bc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13714
diff changeset
  8044
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8045
generateSignaturesForSelectedFiles
13783
00625eec40bc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13714
diff changeset
  8046
    "generate signed pkcs7 files from the contents of the selected files.
00625eec40bc class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13714
diff changeset
  8047
     These can be delivered as expeccoPatch files"
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8048
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8049
    self withActivityIndicationDo:[
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8050
        self currentSelectedFiles do:[:fn |
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8051
            |pkcs7SignedData signatureFilename|
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8052
8646
8046120212f6 generating signed files
Stefan Vogel <sv@exept.de>
parents: 8645
diff changeset
  8053
            self notify:'Generating signed file from: ', (fn baseName), '...'.
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8054
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8055
            pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile.
12094
1ac25533a0d3 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12062
diff changeset
  8056
            signatureFilename := fn withSuffix:'expeccoPatch'.
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  8057
            signatureFilename contents:pkcs7SignedData.
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8058
        ].
13677
1b97a31ac83f class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 13521
diff changeset
  8059
        self updateCurrentDirectoryWithReread.
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8060
        self notify:nil.
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8061
    ]
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8062
!
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  8063
9784
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8064
inspectXmlFile
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8065
    "Show an XML file - either in an XMLInspector or fall back to
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8066
     a plain inspector on the XML tree"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8067
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8068
    self forEachParsedXmlFileDo:[:xmlDocument |
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8069
        XML::XMLInspector notNil ifTrue:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8070
            XML::XMLInspector openOn:xmlDocument.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8071
        ] ifFalse:[
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8072
            "fall back..."
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8073
            xmlDocument inspect.
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8074
        ]
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8075
    ].
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8076
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8077
    "Modified: / 17-02-2011 / 13:58:16 / cg"
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8078
!
afeca3b8a748 refactored
Claus Gittinger <cg@exept.de>
parents: 9764
diff changeset
  8079
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8080
installAllAsAutoloaded
321c1729db5b initial checkin
penk
parents:
diff changeset
  8081
    "install all classes found here as autoloaded classes"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8082
9674
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8083
    self installAllAsAutoloadedRecursive:false
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8084
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8085
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8086
installAllAsAutoloadedRecursive
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8087
    "install all classes found here and in subdirectories as autoloaded classes"
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8088
9674
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8089
    self installAllAsAutoloadedRecursive:true
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8090
!
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8091
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8092
installAllAsAutoloadedRecursive:aBoolean
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8093
    "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
  8094
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8095
    [
15507
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8096
        LoadInProgressQuery answerNotifyLoadingDo:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8097
            |installAction|
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8098
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8099
            installAction := 
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8100
                [:fn |
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8101
                    (fn suffix = 'st') ifTrue:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8102
                        self notify:('Install as autoloaded: ', fn baseName).
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8103
                        self installAsAutoloaded:fn.
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8104
                    ]
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8105
                ].
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8106
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8107
            self withActivityIndicationDo:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8108
                self currentSelectedDirectories do:[:dir|
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8109
                    aBoolean ifTrue:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8110
                        dir recursiveDirectoryContentsAsFilenamesDo:installAction
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8111
                    ] ifFalse:[
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8112
                        dir directoryContentsAsFilenamesDo:installAction
15152
d5f4755c217b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15111
diff changeset
  8113
                    ].
9674
3c3c1ef9974b added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents: 9649
diff changeset
  8114
                ].
15507
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8115
                self notify:nil.
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8116
            ].
fe66ebdf481d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15346
diff changeset
  8117
        ]
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8118
    ] fork.
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8119
!
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  8120
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8121
installAsAutoloaded:aFilename
321c1729db5b initial checkin
penk
parents:
diff changeset
  8122
    "install aFilename as autoloaded class"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8123
13292
37cf92626327 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13232
diff changeset
  8124
    Smalltalk installAutoloadedClassFromSourceFile:aFilename
37cf92626327 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13232
diff changeset
  8125
37cf92626327 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13232
diff changeset
  8126
    "Modified: / 01-08-2013 / 16:58:09 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8127
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8128
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8129
joinSelectedFiles
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8130
    |selectedFiles numFiles msg outFileName outFile outStream|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8131
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8132
    selectedFiles := self currentSelectedObjects.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8133
    (numFiles := selectedFiles size) <= 1 ifTrue:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8134
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8135
    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
  8136
    outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8137
    outFileName isEmptyOrNil ifTrue:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8138
    outFile := selectedFiles first directory construct:outFileName.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8139
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8140
    outStream := outFile writeStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8141
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8142
    selectedFiles do:[:fileName |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8143
        self notify:('Adding:',  fileName baseName).
17997
03d094e11b46 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17982
diff changeset
  8144
        fileName readingFileDo:[:inStream |
03d094e11b46 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17982
diff changeset
  8145
            inStream copyToEndInto:outStream.
03d094e11b46 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17982
diff changeset
  8146
        ].
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8147
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8148
    outStream close.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8149
    self notify:nil.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8150
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8151
    "Modified: / 04-12-2006 / 13:15:10 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  8152
!
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8153
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8154
loadImageThenDo:aBlock
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8155
    |img path files|
321c1729db5b initial checkin
penk
parents:
diff changeset
  8156
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8157
    files := self currentSelectedFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8158
    files isEmpty ifTrue:[ ^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8159
    files do:[:fileName |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8160
        path := fileName.
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  8161
        path isRegularFile ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8162
            img := Image fromFile:(path pathName).
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8163
            img notNil ifTrue:[
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8164
                aBlock value:img
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8165
            ] ifFalse:[
15346
1220ca6a9666 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15259
diff changeset
  8166
                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
  8167
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8168
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8169
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8170
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8171
13089
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8172
loadSignatureSupport
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8173
    Expecco::KeyFileGenerator isNil ifTrue:[
14047
1bc0c67645f2 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 14012
diff changeset
  8174
        Smalltalk loadPackage:'exept:expecco/license'
13089
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8175
    ].
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8176
!
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  8177
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8178
openASN1Browser
321c1729db5b initial checkin
penk
parents:
diff changeset
  8179
321c1729db5b initial checkin
penk
parents:
diff changeset
  8180
    self openTool:OSI::ASN1Browser 
321c1729db5b initial checkin
penk
parents:
diff changeset
  8181
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8182
321c1729db5b initial checkin
penk
parents:
diff changeset
  8183
openAppletViewer
321c1729db5b initial checkin
penk
parents:
diff changeset
  8184
    |numItems files|
321c1729db5b initial checkin
penk
parents:
diff changeset
  8185
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8186
    files := self currentSelectedFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8187
    (numItems := files size) > 2 ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8188
        (self 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8189
            confirm:(resources string:'open for each of the %1 items ?' 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8190
                                 with:numItems)) ifFalse:[^ self].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8191
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8192
321c1729db5b initial checkin
penk
parents:
diff changeset
  8193
    Java startupJavaSystem.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8194
"/    Java markAllClassesUninitialized.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8195
"/    Java initAllStaticFields.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8196
"/    Java initAllClasses.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8197
321c1729db5b initial checkin
penk
parents:
diff changeset
  8198
    files do:[:fileName |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8199
        |p path|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8200
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8201
        path := fileName.
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  8202
        path isRegularFile ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8203
            p := Java 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8204
                    javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer')
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8205
                    argumentString:path pathName.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8206
            p resume.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8207
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8208
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8209
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8210
321c1729db5b initial checkin
penk
parents:
diff changeset
  8211
openCBrowser
6031
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8212
    |dir files|
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8213
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8214
    dir := self theSingleSelectedDirectoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8215
    dir isNil ifTrue:[ ^ self].
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8216
    self withActivityIndicationDo:[
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  8217
        files := self currentSelectedObjects.
6031
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8218
        files notEmptyOrNil ifTrue:[
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8219
            CBrowser::Browser openOn:files first.
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8220
        ] ifFalse:[
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8221
            CBrowser::Browser openIn:dir.
e30ceda65e5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6022
diff changeset
  8222
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8223
    ]
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8224
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  8225
    "Modified: / 04-12-2006 / 13:15:19 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8226
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8227
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8228
openChangeSetBrowser
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8229
    "open a changeSet browser on the selected file(s)"
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8230
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8231
    self
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8232
        openTool:(UserPreferences current changeSetBrowserClass) 
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8233
        with:#openOnFile: 
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8234
        ignoreDirectories:true
11712
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8235
ed8877d9356b comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents: 11688
diff changeset
  8236
    "Modified (comment): / 27-07-2012 / 20:42:55 / cg"
4230
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8237
!
805e8d4b4ec7 added make.
Claus Gittinger <cg@exept.de>
parents: 4213
diff changeset
  8238
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8239
openChangesBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  8240
    "open a change browser on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8241
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8242
    self currentSelectedDirectories notEmptyOrNil ifTrue:[
18248
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8243
        GitHubSmalltalkPackageReader notNil ifTrue:[
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8244
            self currentSelectedDirectories do:[:fn |
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8245
                (fn suffix = 'package') ifTrue:[
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8246
                    ChangeSetBrowser openOn:(GitHubSmalltalkPackageReader readPackageFrom:fn).
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8247
                ].    
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8248
                (fn suffix = 'class') ifTrue:[
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8249
                    ChangeSetBrowser openOn:(GitHubSmalltalkClassReader readClassFrom:fn).
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8250
                ].    
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8251
            ].
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8252
            ^ self.
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8253
        ].
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8254
    ].
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8255
    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8256
    self openTool:(UserPreferences current changesBrowserClass)
18246
1217eb5963fc #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18175
diff changeset
  8257
18248
0e0b4a81b2a4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18246
diff changeset
  8258
    "Modified: / 30-06-2018 / 20:33:24 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8259
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8260
321c1729db5b initial checkin
penk
parents:
diff changeset
  8261
openDiffView
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8262
    "open a diff-view on the two selected files"
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8263
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8264
    |name1 name2 files title 
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8265
     defaultName defaultDir|
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8266
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8267
    files := self currentSelectedObjects.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8268
    files isEmpty ifTrue:[
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8269
        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
  8270
        ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8271
    ].
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8272
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8273
    (files size == 2) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8274
        name1 := files last.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8275
        name2 := files first.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8276
    ] ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8277
        LastFileDiffFile notNil ifTrue:[
11052
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8278
            LastFileDiffFile exists ifTrue:[
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8279
                name1 := LastFileDiffFile.
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8280
            ].
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8281
"/            | directory |
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8282
"/            directory := self currentDirectory.
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8283
"/            directory notNil ifTrue:[
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8284
"/                lastFile := directory asFilename construct:(LastFileDiffFile baseName).
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8285
"/                (lastFile exists and:[lastFile isReadable]) ifTrue:[
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8286
"/                    name1 := lastFile.
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8287
"/                ]
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8288
"/            ]
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8289
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8290
        name2 := files first.
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8291
        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
  8292
        defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil].
11052
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8293
        defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory].
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8294
        name1 := DialogBox 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8295
                    requestFileName:title 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8296
                    default:defaultName 
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8297
                    ok:(resources string:'OK') 
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8298
                    abort:(resources string:'Compare against File List') 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8299
                    pattern:'*' 
11052
6fb06d6f1bc4 changed: #openDiffView
Claus Gittinger <cg@exept.de>
parents: 10923
diff changeset
  8300
                    fromDirectory:defaultDir.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8301
    ].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8302
    self openDiffViewOn:name1 and:name2
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8303
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8304
    "Modified: / 03-05-2012 / 08:03:16 / cg"
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8305
!
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8306
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8307
openDiffViewOn:fileArg1 and:fileArg2
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8308
    "open a diff-view on two files"
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8309
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8310
    |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
  8311
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8312
    file1 := fileArg1.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8313
    file2 := fileArg2.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8314
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8315
    self withWaitCursorDo:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8316
        (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
  8317
            text1 := self getAllFilesAsStrings asStringCollection withTabs.
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  8318
            text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l string]].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8319
            file1 := nil.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8320
            l1 := 'browser contents'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8321
        ] ifFalse:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8322
            file1 := file1 asFilename.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8323
            LastFileDiffFile := file1.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8324
            file1 isReadable ifFalse:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8325
                nm := file1.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8326
                file1 exists ifFalse:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8327
                    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
  8328
                ] ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8329
                    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
  8330
                ].
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8331
            ].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8332
            l1 := file1 pathName
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8333
        ].
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8334
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8335
        err isNil ifTrue:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8336
            file2 isReadable ifFalse:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8337
                nm := file2.
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8338
                file2 exists ifFalse:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8339
                    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
  8340
                ] ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8341
                    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
  8342
                ].
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8343
            ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8344
        ].
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8345
        err notNil ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8346
            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
  8347
            ^ self
6176
6bc0c44931c9 big file compare
Claus Gittinger <cg@exept.de>
parents: 6169
diff changeset
  8348
        ].
6bc0c44931c9 big file compare
Claus Gittinger <cg@exept.de>
parents: 6169
diff changeset
  8349
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8350
        self withActivityIndicationDo:[
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8351
            file1Size := file1 isNil ifTrue:[0] ifFalse:[file1 fileSize].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8352
            file2Size := file2 isNil ifTrue:[0] ifFalse:[file2 fileSize].
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8353
            
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8354
            ((file1Size > (1024*1024*32)) or:[ file2Size > (1024*1024*32) ]) ifTrue:[
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8355
                file1Size = file2Size ifTrue:[
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8356
                    ProgressIndicator
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8357
                        displayBusyIndicator:'Comparing...'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8358
                        at:(Screen default center)
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8359
                        during:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8360
                            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
  8361
                        ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8362
                    sameContents ifTrue:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8363
                        self information:'Same contents.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8364
                    ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8365
                        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
  8366
                    ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8367
                ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8368
                    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
  8369
                ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8370
                ^ self.
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8371
            ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8372
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8373
            file1 notNil ifTrue:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8374
                file1 isDirectory ifTrue:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8375
                    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
  8376
                ] ifFalse:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8377
                    text1 := file1 contents.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8378
                ]
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8379
            ].
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8380
            file2 isDirectory ifTrue:[
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8381
                text2 := file2 directoryContents asString.
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8382
            ] ifFalse:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8383
                text2 := file2 contents.
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8384
            ].
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8385
            text1 = text2 ifTrue:[
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8386
                (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
  8387
                    msg := 'Same filename lists.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8388
                ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8389
                    msg := 'Same contents.'
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8390
                ].
16911
d71609b50e6d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16825
diff changeset
  8391
                self information:msg
8287
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8392
            ] ifFalse:[
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8393
                d := DiffTextView 
df5c80b5bbfb show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents: 8261
diff changeset
  8394
                        openOn:text1 label:l1
15215
3d4164587084 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15212
diff changeset
  8395
                        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
  8396
                d topView label:(resources string:'File Differences').
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8397
            ]
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8398
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8399
    ]
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8400
17769
156241c3adef #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17768
diff changeset
  8401
    "Modified: / 19-11-2017 / 15:00:47 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8402
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8403
9496
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8404
openDirectoryDiffView
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8405
    "open a directory diff-view"
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8406
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8407
    |name1 name2 files|
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8408
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8409
    files := self currentSelectedObjects.
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8410
    files notEmpty ifTrue:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8411
        name1 := files first asFilename.
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  8412
        name1 asFilename isRegularFile ifTrue:[
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8413
            name1 := name1 directory
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8414
        ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8415
    ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8416
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8417
    (files size == 2) ifTrue:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8418
        name2 := files second.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8419
    ] ifFalse:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8420
        (files size ~= 1) ifTrue:[
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8421
            Dialog warn:(resources string:'Please select one or two directories.').
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8422
            ^ self.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8423
        ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8424
        name2 := Dialog 
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8425
                    requestDirectoryName:(resources
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8426
                                            string:'Recursive compare "%1" with folder:' 
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8427
                                            with:name1 asFilename baseName)
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8428
                    default:(LastFileDiffDirectory ? self currentDirectory).
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8429
        name2 isEmptyOrNil ifTrue:[^ self].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8430
        LastFileDiffDirectory := name2.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8431
    ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8432
    name2 := name2 asFilename.
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8433
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  8434
    name2 asFilename isRegularFile ifTrue:[
11108
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8435
        name2 := name2 directory
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8436
    ].
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8437
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8438
    self 
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8439
        applicationNamed:#FileApplicationNoteBook
f13e428f8d06 class definition
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  8440
        ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2].
9496
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8441
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8442
    "Created: / 20-05-2010 / 15:01:17 / cg"
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8443
!
0cfc347edb59 added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents: 9493
diff changeset
  8444
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8445
openEditor
321c1729db5b initial checkin
penk
parents:
diff changeset
  8446
    self openTool:EditTextView
321c1729db5b initial checkin
penk
parents:
diff changeset
  8447
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8448
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8449
openGV
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8450
    self openOSCommandWithFiles:'gv'
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8451
!
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8452
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8453
openHTMLReader
321c1729db5b initial checkin
penk
parents:
diff changeset
  8454
321c1729db5b initial checkin
penk
parents:
diff changeset
  8455
    self openTool:HTMLDocumentView ignoreDirectories:false
321c1729db5b initial checkin
penk
parents:
diff changeset
  8456
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8457
321c1729db5b initial checkin
penk
parents:
diff changeset
  8458
openImageEditor
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8459
    [
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8460
        self loadImageThenDo:[:img | img edit]
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8461
    ] fork
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8462
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8463
321c1729db5b initial checkin
penk
parents:
diff changeset
  8464
openImageInspector
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8465
    [
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8466
        self loadImageThenDo:[:img | img inspect]
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8467
    ] fork
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8468
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8469
321c1729db5b initial checkin
penk
parents:
diff changeset
  8470
openImagePreview
5778
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8471
    [
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8472
        self 
6292
bce1479e1e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
  8473
            loadImageThenDo:
5778
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8474
                [:img |
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8475
                    |i top viewer|
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8476
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8477
                    top := StandardSystemView new.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8478
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8479
                    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
  8480
                    i := img.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8481
                    top extent:200@200.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8482
                    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
  8483
                    top openAndWait.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8484
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8485
                    (i width > 200 or:[i height > 200]) ifTrue:[
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8486
                        i := i magnifiedPreservingRatioTo:200@200.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8487
                    ].
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8488
                    viewer image:i.
15da4590fcd5 separatorString / separator
Claus Gittinger <cg@exept.de>
parents: 5772
diff changeset
  8489
                ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8490
    ] fork
321c1729db5b initial checkin
penk
parents:
diff changeset
  8491
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8492
321c1729db5b initial checkin
penk
parents:
diff changeset
  8493
openMP3Player
321c1729db5b initial checkin
penk
parents:
diff changeset
  8494
    |file|
321c1729db5b initial checkin
penk
parents:
diff changeset
  8495
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8496
    file := self currentSelectedFiles.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8497
    (file isEmpty) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8498
        ^ self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8499
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8500
    file := file first.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8501
    (MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8502
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8503
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8504
openOSCommandWithFiles:command
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8505
    |files fileNames|
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8506
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8507
    files := self currentSelectedFiles.
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8508
    (files isEmpty) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8509
        ^ self.
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8510
    ].
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8511
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8512
    fileNames := files collect:[:each |
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8513
                    '"' , each asFilename pathName , '"'
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8514
                 ].
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8515
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8516
    [
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8517
        OperatingSystem 
4959
Claus Gittinger <cg@exept.de>
parents: 4958
diff changeset
  8518
            executeCommand:command , ' ' , fileNames asStringCollection asString
Claus Gittinger <cg@exept.de>
parents: 4958
diff changeset
  8519
            inDirectory:(files first asFilename directory).
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8520
    ] fork
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8521
!
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8522
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8523
openPDFViewer
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8524
    |files fileNames cmd arg|
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8525
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8526
    files := self currentSelectedFiles.
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8527
    (files isEmpty) ifTrue:[
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8528
        ^ self.
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8529
    ].
12972
b7a2f930c5f2 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12963
diff changeset
  8530
    cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'.
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8531
    cmd isNil ifTrue:[
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8532
        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
  8533
        ^ self.
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8534
    ].
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8535
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8536
    fileNames := 
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8537
        files 
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8538
            collect:
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8539
                [:each |
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8540
                    '"' , each asFilename pathName , '"'
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8541
                ].
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8542
    arg := fileNames asStringCollection asStringWith:' '.
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8543
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8544
    (cmd includesString:'"%1"') ifTrue:[
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8545
        cmd := cmd copyReplaceString:'"%1"' withString:'%1'    
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8546
    ].
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8547
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8548
    [
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8549
        OperatingSystem executeCommand:(cmd bindWith:arg).
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8550
    ] fork
5836
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8551
922c94b683a1 ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents: 5832
diff changeset
  8552
    "Modified: / 12-05-2004 / 12:31:20 / cg"
4820
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8553
!
8046b45e1569 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  8554
4958
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8555
openRP
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8556
    self openOSCommandWithFiles:'realplay'
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8557
!
Claus Gittinger <cg@exept.de>
parents: 4957
diff changeset
  8558
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8559
openResourceFileEditor
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8560
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8561
    self 
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8562
        openTool: Tools::InternationalLanguageTranslationEditor
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8563
        with: #openOnFile:
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8564
!
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8565
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8566
openSlideShow
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8567
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8568
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8569
    dir := self theSingleSelectedDirectoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8570
    dir isNil ifTrue:[^ self].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8571
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8572
    CodingExamples_GUI::SlideShow openIn:dir.
321c1729db5b initial checkin
penk
parents:
diff changeset
  8573
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8574
321c1729db5b initial checkin
penk
parents:
diff changeset
  8575
openSnapshotImageBrowser
4491
b5f8412a83e2 comments
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  8576
    "Sorry, for now, only the old browser can handle snapShotImages."
b5f8412a83e2 comments
Claus Gittinger <cg@exept.de>
parents: 4486
diff changeset
  8577
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8578
    ^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  8579
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8580
321c1729db5b initial checkin
penk
parents:
diff changeset
  8581
openTerminal
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8582
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8583
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8584
    dir := self theSingleSelectedDirectoryOrHomeDir.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8585
5300
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8586
    TerminalApplication notNil ifTrue:[
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8587
        TerminalApplication openIn:dir
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8588
    ] ifFalse:[
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8589
        VT100TerminalView openShellIn:dir.
260ccc2864cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5290
diff changeset
  8590
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8591
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8592
321c1729db5b initial checkin
penk
parents:
diff changeset
  8593
openTool:aToolClass
321c1729db5b initial checkin
penk
parents:
diff changeset
  8594
    "open a tool on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8595
321c1729db5b initial checkin
penk
parents:
diff changeset
  8596
    ^ self openTool:aToolClass ignoreDirectories:true
321c1729db5b initial checkin
penk
parents:
diff changeset
  8597
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8598
321c1729db5b initial checkin
penk
parents:
diff changeset
  8599
openTool:aToolClass ignoreDirectories:ignoreDirs
321c1729db5b initial checkin
penk
parents:
diff changeset
  8600
    "open a tool on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8601
321c1729db5b initial checkin
penk
parents:
diff changeset
  8602
    ^ self
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8603
        openTool:aToolClass 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8604
        with:#openOn: 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8605
        ignoreDirectories:ignoreDirs
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8606
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8607
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8608
openTool:aToolClass with:aSelector
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8609
    "open a tool on the selected file(s)"
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8610
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8611
    ^ self openTool:aToolClass with:aSelector ignoreDirectories:true
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8612
!
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  8613
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8614
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs
321c1729db5b initial checkin
penk
parents:
diff changeset
  8615
    "open a tool on the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8616
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8617
    |tool|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8618
321c1729db5b initial checkin
penk
parents:
diff changeset
  8619
    aToolClass isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8620
        Dialog warn:'Sorry, that tool seems to be not available'.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  8621
        ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8622
    ].
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8623
    self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path |
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8624
        tool := aToolClass perform:aSelector with:path.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8625
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8626
    ^ tool
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8627
!
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8628
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
  8629
openWebBrowser
9343
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8630
    self 
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8631
        forEachSelectedFileIgnoringDirectories:true 
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8632
        do:[:path |
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8633
            Error
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8634
                handle:[:ex |
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8635
                    Dialog warn:'Shell execution failed: ',ex description
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8636
                ] do:[
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8637
                    OperatingSystem openApplicationForDocument:path operation:#open.
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8638
                    ^ self.
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8639
                ]
895543baebfe added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents: 9338
diff changeset
  8640
        ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8641
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8642
6022
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8643
openWorkspace
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8644
    self 
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8645
        openTool:WorkspaceApplication 
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8646
        with:#openOnFile:
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8647
        ignoreDirectories:true
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8648
!
f2a53298475e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5977
diff changeset
  8649
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8650
openXV
4957
Claus Gittinger <cg@exept.de>
parents: 4955
diff changeset
  8651
    self openOSCommandWithFiles:'xv'
4950
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8652
!
d0b7db4bfba5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4940
diff changeset
  8653
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8654
openZipTool
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8655
    |zipTool|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8656
321c1729db5b initial checkin
penk
parents:
diff changeset
  8657
    (zipTool := self openTool:ZipTool) notNil ifTrue:[
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8658
        zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir).
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8659
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8660
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8661
321c1729db5b initial checkin
penk
parents:
diff changeset
  8662
readAbbrevFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  8663
    "read the abbrev file and install classes found there as autoloaded classes"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8664
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8665
    |directories|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8666
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  8667
    directories := self currentSelectedDirectories.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8668
    directories isEmpty ifTrue:[^ self].
321c1729db5b initial checkin
penk
parents:
diff changeset
  8669
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8670
    self withActivityIndicationDo:[
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8671
        directories do:[:eachDir |
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8672
            Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc').
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  8673
        ]
5828
67b58a435b3e wait cursor
Claus Gittinger <cg@exept.de>
parents: 5810
diff changeset
  8674
    ]
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8675
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  8676
    "Modified: / 25-07-2006 / 09:07:43 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8677
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  8678
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8679
readAndShowResources
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8680
    self withActivityIndicationDo:[
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8681
        | selectedFiles|
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8682
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8683
        selectedFiles:= self currentSelectedFiles.
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8684
        selectedFiles do:[:fileName |
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8685
            resources := ResourcePack fromFile:fileName.
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8686
            resources inspect.
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8687
        ].
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8688
    ]
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8689
!
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  8690
17831
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8691
removeBakAndSavFiles
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8692
    "remove all .sav and .bak files (after confirmation)"
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8693
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8694
    |filesToRemove directories|
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8695
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8696
    directories := self currentSelectedDirectories.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8697
    directories isEmptyOrNil ifTrue:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8698
        directories := Array with:self currentDirectory
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8699
    ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8700
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8701
    self withActivityIndicationDo:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8702
        filesToRemove := OrderedCollection new.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8703
        directories do:[:eachDirectoryToScan |
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8704
            eachDirectoryToScan filesDo:[:fn |
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8705
                (#('sav' 'bak') includes:fn suffix) ifTrue:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8706
                    filesToRemove add:fn.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8707
                ]
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8708
            ]
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8709
        ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8710
        filesToRemove isEmpty ifTrue:[
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8711
            Dialog information:(resources string:'Nothing to remove').
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8712
            ^ self.
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8713
        ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8714
        (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
  8715
            ^ self
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8716
        ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8717
        filesToRemove do:[:each |
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8718
            each remove
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8719
        ].
17871
7f0b6e10415d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17869
diff changeset
  8720
        self updateCurrentDirectoryWithReread
17831
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8721
    ].
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8722
!
84a4c9f364e4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17818
diff changeset
  8723
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  8724
singleFileFileIn:fileName lazy:lazy
321c1729db5b initial checkin
penk
parents:
diff changeset
  8725
    "fileIn the selected file(s)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  8726
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8727
    |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
  8728
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8729
    fileName isRegularFile ifFalse:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8730
        ^ self.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8731
    ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8732
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8733
    [
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8734
        (ObjectFileLoader notNil
5491
755cec01b183 Accept Filenames in loadFile:
Stefan Vogel <sv@exept.de>
parents: 5478
diff changeset
  8735
         and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8736
            AbortOperationRequest catch:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8737
                |p|
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8738
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8739
                "/
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8740
                "/ look if already loaded ...  then unload first
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8741
                "/
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8742
                p := fileName pathName.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8743
                (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8744
                    (Dialog confirm:(resources 
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8745
                                        string:'%1 is already loaded; load anyway ?'
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8746
                                        with:p)) ifFalse:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8747
                        ^ self
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8748
                    ].
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8749
                    notifyString := 'unloading old ' , p , ' ...'.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8750
                    Transcript showCR:notifyString.
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  8751
                    self notify:notifyString.
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8752
                    ObjectFileLoader unloadObjectFile:p. 
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8753
                ].
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8754
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8755
                notifyString := 'loading ' , p , ' ...'.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8756
                Transcript showCR:notifyString.
4523
ae3d65269e21 added notify: method;
Claus Gittinger <cg@exept.de>
parents: 4521
diff changeset
  8757
                self notify:notifyString.
12426
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8758
                (ObjectFileLoader loadObjectFile:p) isNil ifTrue:[
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8759
                    notifyString := 'Error: could not load ' , p.
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8760
                    Transcript showCR:notifyString.
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8761
                    self notify:notifyString.
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8762
               ] ifFalse:[
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8763
                    Class addInfoRecord:('fileIn ' , fileName asFilename pathName) 
700b06622522 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12421
diff changeset
  8764
                ].
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8765
            ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8766
        ] ifFalse:[ ((fileName hasSuffix:'cls') 
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8767
                     and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8768
            "/ loading a binary class file
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  8769
            aStream := fileName readStreamOrNil.
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8770
            aStream notNil ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8771
                aStream fileInBinary.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8772
            ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8773
        ] ifFalse:[
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8774
            ((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8775
                "/ loading a java class file
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8776
                JavaClassReader notNil ifTrue:[
5491
755cec01b183 Accept Filenames in loadFile:
Stefan Vogel <sv@exept.de>
parents: 5478
diff changeset
  8777
                    JavaClassReader loadFile:fileName
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8778
                ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8779
            ] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8780
                "/ loading a sif (smalltalk interchange format) file
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8781
                SmalltalkInterchangeSTXFileInManager autoload.    
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8782
                SmalltalkInterchangeFileManager newForFileIn
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8783
                    fileName: fileName pathName;
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8784
                    fileIn.
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8785
            ] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8786
                Parcel isNil ifTrue:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8787
                    Dialog warn:'Parcel support not loaded.'
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8788
                ] ifFalse:[
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8789
                    Parcel loadParcelFrom: fileName pathName
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8790
                ]
13968
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8791
            ] ifFalse:[ (fileName hasSuffix:'jar') ifTrue:[
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8792
                JavaVM isNil ifTrue:[ 
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8793
                    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
  8794
                    ^ self.
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8795
                ] ifFalse:[
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8796
                    JavaVM booted ifFalse:[ 
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8797
                        (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
  8798
                        JavaVM boot.
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8799
                    ].
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8800
                    JavaVM loadClassesIn: fileName.  
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8801
                ]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8802
            ] ifFalse:[
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8803
                "/ ask programming languages...
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8804
                lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil.
14360
7459355f5a90 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14308
diff changeset
  8805
                (lang isNil and:[(fileName hasSuffix:'js')]) ifTrue:[
14362
b03192e7a145 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14360
diff changeset
  8806
                    Smalltalk loadPackage:'stx:libjavascript'.
14360
7459355f5a90 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14308
diff changeset
  8807
                    lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil.
7459355f5a90 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14308
diff changeset
  8808
                ].
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8809
                (lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8810
                    lang fileIn:fileName.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8811
                ] ifFalse:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8812
                    "/ loading a regular (chunk) or xml source file
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8813
                    Error handle:[:ex |
15675
ac6981afbb9b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15597
diff changeset
  8814
                        self errorNotify:'Error during file in: ', ex description.
15981
Stefan Vogel <sv@exept.de>
parents: 15936
diff changeset
  8815
                        ex resume.
9299
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8816
                    ] do:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8817
                        aStream := fileName readStream.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8818
                        [
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8819
                            Class withoutUpdatingChangesDo:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8820
                                wasLazy := Compiler compileLazy:lazy.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8821
                                Smalltalk fileInStream:aStream.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8822
                            ].
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8823
                            Class addInfoRecord:('fileIn ' , fileName asString) 
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8824
                        ] ensure:[
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8825
                            Compiler compileLazy:wasLazy.
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8826
                            aStream close
3c234ab3fae2 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 9296
diff changeset
  8827
                        ]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8828
                    ]
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8829
                ]
13968
45cdc56fd50a Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13910
diff changeset
  8830
            ]]]]
4345
7094ddfde188 *** empty log message ***
penk
parents: 4343
diff changeset
  8831
        ]]
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8832
    ] 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
  8833
        |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
  8834
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8835
        isRedef := false.
12684
cc8a225600bd class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12602
diff changeset
  8836
        sig := ex creator.
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8837
        (dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8838
            action := #continue    
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8839
        ] ifFalse:[
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8840
            (sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8841
                ex reject
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8842
            ].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8843
            sig == Class methodRedefinitionNotification ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8844
                msg := 'trying to overwrite method:\\    ' , ex oldMethod whoString , '\\in package ''' 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8845
                       , ex oldPackage , ''' with method from package ''' , ex newPackage , ''''.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8846
                label := 'Method redefinition in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8847
                redefKind := 'method'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8848
                isRedef := true.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8849
            ] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8850
                msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8851
                       , ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8852
                label := 'Class redefinition in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8853
                redefKind := 'class'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8854
                isRedef := true.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8855
            ] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender|
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8856
                label := msg := 'Breakpoint/Halt in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8857
                sender := ex suspendedContext.
18666
96b9b1954989 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18609
diff changeset
  8858
                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
  8859
            ] ifFalse:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8860
                label := 'Error in fileIn'.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8861
                msg := 'error in fileIn: %1'
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8862
            ]]].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8863
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8864
            msg := msg bindWith:ex description.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8865
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8866
            labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources').
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8867
            values := #(abort     skip  debug   compareSources).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8868
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8869
            isRedef ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8870
                  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
  8871
    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
  8872
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8873
                  labels := labels , #('Keep Package' ).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8874
                  values := values , #(keep).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8875
            ].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8876
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8877
            labels := labels , #( 'Continue' 'ContinueForAll').
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8878
            values := values , #(  continue   continueForAll).
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8879
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8880
            AbortAllOperationWantedQuery query ifTrue:[
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8881
                  labels := #('Cancel All') , labels.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8882
                  values := #(cancelAll) , values.
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8883
            ].
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8884
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8885
            action := Dialog 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8886
                          choose:(msg withCRs) 
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8887
                          label:label
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8888
                          image:(WarningBox iconBitmap)
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8889
                          labels:labels
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8890
                          values:values
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8891
                          default:#continue
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8892
                          onCancel:#abort.
6281
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8893
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8894
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8895
        action == #continueForAll ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8896
            dontAskSignals isNil ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8897
                dontAskSignals := IdentityDictionary new.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8898
            ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8899
            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
  8900
            action := #continue.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8901
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8902
8887
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8903
        (action == #compareSources) ifTrue:[
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8904
            DiffCodeView 
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8905
                openOn:(ex oldMethod source) label:'Old Source'
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8906
                and:(ex newMethod source) label:'New Source'
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8907
                title:ex description.
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8908
            ex resignalAs:ex
f9ab42af84ff changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 8882
diff changeset
  8909
        ].
8082
40a926dc460d On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents: 8068
diff changeset
  8910
        (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
  8911
            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
  8912
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8913
        action == #abort ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8914
            AbortOperationRequest raise.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8915
            ex return
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8916
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8917
        action == #cancelAll ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8918
            AbortAllOperationRequest raise.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8919
            ex return
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8920
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8921
        action == #skip ifTrue:[
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8922
            ex proceedWith:nil
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8923
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8924
        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
  8925
            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
  8926
                     withMessage:ex description 
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8927
                     mayProceed:true.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8928
            ex proceedWith:nil.
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8929
        ].
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8930
        ex reject
e8e47b1b290f Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents: 6265
diff changeset
  8931
    ]
7040
19c639b3b68d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6952
diff changeset
  8932
10887
f2a55c7f0ed6 changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents: 10775
diff changeset
  8933
    "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
  8934
    "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
  8935
!
c4783f6dfd7a menu reordered
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8936
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8937
splitFile:infile intoPiecesOfSize:kiloBytes
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8938
    |bytesPerSplit splitIndex bufferSize buffer n
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8939
     inStream outFile outStream remaining remainingInThisOutfile|
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8940
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8941
    bufferSize := 32*1024.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8942
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8943
    inStream := infile readStream.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8944
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8945
    bytesPerSplit := kiloBytes * 1024.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8946
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8947
    remaining := infile fileSize.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8948
    splitIndex := 1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8949
    [remaining > 0] whileTrue:[
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8950
        outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0).
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8951
        outStream := outFile asFilename writeStream.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8952
        remainingInThisOutfile := remaining min:bytesPerSplit.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8953
        [remainingInThisOutfile > 0] whileTrue:[
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8954
            buffer := ByteArray new:bufferSize.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8955
            n := inStream 
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8956
                    nextBytes:(bufferSize min:remainingInThisOutfile)
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8957
                    into:buffer 
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8958
                    startingAt:1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8959
            outStream nextPutBytes:n from:buffer startingAt:1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8960
            remainingInThisOutfile := remainingInThisOutfile - n.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8961
            remaining := remaining - n.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8962
        ].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8963
        outStream close.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8964
        splitIndex := splitIndex + 1.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8965
    ].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8966
    inStream close.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8967
!
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8968
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8969
splitFile:infile intoPiecesWithNumberOfLines:numberOfLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8970
    |splitIndex line
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8971
     inStream outFile outStream remainingLinesInThisOutfile|
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8972
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8973
    inStream := infile readStream.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8974
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8975
    splitIndex := 1.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8976
    [inStream atEnd] whileFalse:[
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8977
        outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0).
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8978
        outStream := outFile asFilename writeStream.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8979
        remainingLinesInThisOutfile := numberOfLines.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8980
        [(remainingLinesInThisOutfile > 0) and:[inStream atEnd not]] whileTrue:[
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8981
            line := inStream nextLine.
15910
Claus Gittinger <cg@exept.de>
parents: 15906
diff changeset
  8982
            outStream nextPutLine:line.
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8983
            remainingLinesInThisOutfile := remainingLinesInThisOutfile - 1.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8984
        ].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8985
        outStream close.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8986
        splitIndex := splitIndex + 1.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8987
    ].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8988
    inStream close.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8989
!
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  8990
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8991
splitSelectedFiles
6264
039dc5c1710b slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  8992
    |selectedFiles numFiles msg sizeString kiloBytes|
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8993
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  8994
    selectedFiles := self currentSelectedFiles.
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8995
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  8996
6265
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  8997
    msg := (numFiles > 1) 
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  8998
                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
  8999
                ifFalse:'Split %2 into pieces of size (in kB):'.
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9000
6352
1dfde810826f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6346
diff changeset
  9001
    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
  9002
    sizeString isEmptyOrNil ifTrue:[^ self].
039dc5c1710b slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
  9003
    kiloBytes := Integer readFrom:sizeString onError:nil.
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9004
    kiloBytes isNil ifTrue:[^ self].
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9005
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9006
    selectedFiles do:[:fileName |
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9007
        fileName isRegularFile ifTrue:[
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9008
            self notify:('Splitting:',  fileName baseName).
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9009
            self splitFile:fileName intoPiecesOfSize:kiloBytes.
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9010
        ]
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9011
    ].
6190
b3ab1d955319 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6176
diff changeset
  9012
    self notify:nil.
6265
19f8b1250d41 slight code cleanup
Claus Gittinger <cg@exept.de>
parents: 6264
diff changeset
  9013
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9014
    "Modified: / 04-12-2006 / 13:15:26 / cg"
4558
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9015
!
9f64535810cd split and join added
Claus Gittinger <cg@exept.de>
parents: 4554
diff changeset
  9016
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9017
splitSelectedFilesByLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9018
    |selectedFiles numFiles msg numLinesString numLines|
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9019
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9020
    selectedFiles := self currentSelectedFiles.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9021
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9022
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9023
    msg := (numFiles > 1) 
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9024
                ifTrue:'Split each of the %1 files into pieces with number of lines:'
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9025
                ifFalse:'Split %2 into pieces with number of lines:'.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9026
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9027
    numLinesString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName).
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9028
    numLinesString isEmptyOrNil ifTrue:[^ self].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9029
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9030
    numLines := Integer readFrom:numLinesString onError:nil.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9031
    numLines isNil ifTrue:[^ self].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9032
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9033
    selectedFiles do:[:fileName |
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9034
        fileName isRegularFile ifTrue:[
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9035
            self notify:('Splitting:',  fileName baseName).
15906
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9036
            self splitFile:fileName intoPiecesWithNumberOfLines:numLines
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9037
        ]
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9038
    ].
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9039
    self notify:nil.
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9040
!
1c4d247a06d9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 15905
diff changeset
  9041
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9042
truncateSelectedFilesToZeroSize
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9043
    |selectedFiles numFiles msg|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9044
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9045
    selectedFiles := self currentSelectedObjects.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9046
    (numFiles := selectedFiles size) == 0 ifTrue:[^ self].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9047
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9048
    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
  9049
    numFiles > 1 ifTrue:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9050
        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
  9051
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9052
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9053
    (Dialog 
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9054
        confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold)
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9055
        initialAnswer:false
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9056
    ) ifFalse:[
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9057
        ^ self
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9058
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9059
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9060
    selectedFiles do:[:fileName |
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9061
        |s|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9062
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9063
        fileName isRegularFile ifTrue:[
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9064
            self notify:('Truncating:',  fileName baseName).
15211
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9065
            [
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9066
                s := fileName writeStream.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9067
                s close.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9068
            ] on:FileStream openErrorSignal do:[:ex|
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9069
                self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold).
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9070
            ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9071
        ]
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9072
    ].
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9073
    self notify:nil.
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9074
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9075
    "Modified: / 04-12-2006 / 13:15:28 / cg"
56568f030d10 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15210
diff changeset
  9076
! !
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9077
4849
ad567cb531d1 cvs-add binary
Claus Gittinger <cg@exept.de>
parents: 4820
diff changeset
  9078
!AbstractFileBrowser methodsFor:'menu queries-tools'!
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9079
321c1729db5b initial checkin
penk
parents:
diff changeset
  9080
anySTFilesPresent
321c1729db5b initial checkin
penk
parents:
diff changeset
  9081
    ^ self anyFilesPresentWithSuffix:'st'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9082
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9083
321c1729db5b initial checkin
penk
parents:
diff changeset
  9084
canCreateNewProject
321c1729db5b initial checkin
penk
parents:
diff changeset
  9085
    self currentFilesAreInSameDirectory ifFalse:[^ false].
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9086
    ^ self currentSelectedFiles 
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9087
        contains:[:fileName| 
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9088
            | suffix|
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9089
            suffix := fileName suffix asLowercase.
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9090
            (suffix = 'prj' or:[suffix = 'st'])
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9091
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9092
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9093
321c1729db5b initial checkin
penk
parents:
diff changeset
  9094
canDoTerminal
321c1729db5b initial checkin
penk
parents:
diff changeset
  9095
321c1729db5b initial checkin
penk
parents:
diff changeset
  9096
    ^ OperatingSystem isUNIXlike
321c1729db5b initial checkin
penk
parents:
diff changeset
  9097
      or:[OperatingSystem isMSWINDOWSlike]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9098
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9099
321c1729db5b initial checkin
penk
parents:
diff changeset
  9100
canDoTerminalAndSystemIsDOS
321c1729db5b initial checkin
penk
parents:
diff changeset
  9101
321c1729db5b initial checkin
penk
parents:
diff changeset
  9102
    ^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9103
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9104
321c1729db5b initial checkin
penk
parents:
diff changeset
  9105
canDoTerminalAndSystemIsUnix
321c1729db5b initial checkin
penk
parents:
diff changeset
  9106
321c1729db5b initial checkin
penk
parents:
diff changeset
  9107
    ^ self canDoTerminal and:[OperatingSystem isUNIXlike]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9108
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9109
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  9110
canGenerateSignatureFiles
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  9111
    "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
  9112
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  9113
    Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ].
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  9114
    Expecco::KeyFile isNil ifTrue:[ ^ false ].
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  9115
8645
00e4d07c6d6d Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents: 8641
diff changeset
  9116
    ^ self currentSelectedFiles notEmptyOrNil
8640
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  9117
!
fe2bc358dec4 added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents: 8617
diff changeset
  9118
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9119
canOpenMonticelloBrowser
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9120
    ^ self currentSelectedFiles
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9121
        contains:[:fileName|
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9122
            fileName suffix sameAs:'mcz'
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9123
        ]
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9124
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9125
    "Modified: / 01-05-2019 / 11:21:16 / Claus Gittinger"
12811
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9126
!
ffdf97bbca6e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12777
diff changeset
  9127
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9128
canReadAbbrevFile
321c1729db5b initial checkin
penk
parents:
diff changeset
  9129
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  9130
    |currentDirectory|
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9131
321c1729db5b initial checkin
penk
parents:
diff changeset
  9132
    self currentFilesAreInSameDirectory ifFalse:[^ false].
5960
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  9133
    currentDirectory := self currentDirectory.
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  9134
    ^ currentDirectory notNil 
aa171aa05bab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5959
diff changeset
  9135
      and:[ (currentDirectory construct:'abbrev.stc') exists ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9136
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9137
321c1729db5b initial checkin
penk
parents:
diff changeset
  9138
canRemoveFromSourcePath
321c1729db5b initial checkin
penk
parents:
diff changeset
  9139
321c1729db5b initial checkin
penk
parents:
diff changeset
  9140
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  9141
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9142
13089
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  9143
cannotGenerateSignatureFiles
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  9144
    ^ self canGenerateSignatureFiles not
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  9145
!
70766b1c3b0d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 13011
diff changeset
  9146
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9147
hasASN1
321c1729db5b initial checkin
penk
parents:
diff changeset
  9148
    ^ [ OSI::ASN1Parser notNil 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9149
        and:[OSI::ASN1Parser isLoaded]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9150
321c1729db5b initial checkin
penk
parents:
diff changeset
  9151
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9152
321c1729db5b initial checkin
penk
parents:
diff changeset
  9153
hasASN1AndSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9154
    ^ [ self hasSelection value 
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  9155
        and:[self currentSelectedFiles notEmptyOrNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9156
        and:[OSI::ASN1Parser notNil 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9157
        and:[OSI::ASN1Parser isLoaded]]]]
17416
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  9158
ccd3335a762a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17413
diff changeset
  9159
    "Modified: / 17-02-2017 / 08:25:09 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9160
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9161
321c1729db5b initial checkin
penk
parents:
diff changeset
  9162
hasCBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  9163
    ^ [ CBrowser::Browser notNil ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9164
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9165
321c1729db5b initial checkin
penk
parents:
diff changeset
  9166
hasJava
321c1729db5b initial checkin
penk
parents:
diff changeset
  9167
14298
dbcceba5f47e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14262
diff changeset
  9168
    ^ [ JavaVM notNil 
dbcceba5f47e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14262
diff changeset
  9169
        and:[JavaClassReader notNil 
dbcceba5f47e class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14262
diff changeset
  9170
        and:[JavaClassReader isLoaded]]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9171
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9172
321c1729db5b initial checkin
penk
parents:
diff changeset
  9173
hasJavaAndSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9174
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9175
    ^ [ self currentSelectedFiles notEmptyOrNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9176
        and:[JavaClassReader notNil 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9177
        and:[JavaClassReader isLoaded]]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9178
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9179
321c1729db5b initial checkin
penk
parents:
diff changeset
  9180
hasMP3Player
321c1729db5b initial checkin
penk
parents:
diff changeset
  9181
321c1729db5b initial checkin
penk
parents:
diff changeset
  9182
    ^ [ MP3PlayerApplication notNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9183
        or:[SaugFix::MP3PlayerApplication notNil ]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9184
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9185
321c1729db5b initial checkin
penk
parents:
diff changeset
  9186
hasMP3PlayerAndSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9187
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9188
    ^ [ self currentSelectedFiles notEmptyOrNil
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9189
        and:[ self hasMP3Player value]]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9190
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9191
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9192
hasResourceFileSelected
12871
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9193
    ^ (self currentSelectedFiles) 
74bdca95981d class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12858
diff changeset
  9194
        contains:[:fn | 
18746
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9195
            fn suffix sameAs:'rs'
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9196
        ].
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9197
a12a52c66c53 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18734
diff changeset
  9198
    "Modified: / 01-05-2019 / 11:23:30 / Claus Gittinger"
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9199
!
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9200
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9201
hasSlideShow
321c1729db5b initial checkin
penk
parents:
diff changeset
  9202
321c1729db5b initial checkin
penk
parents:
diff changeset
  9203
    ^ [CodingExamples_GUI::SlideShow notNil]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9204
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9205
321c1729db5b initial checkin
penk
parents:
diff changeset
  9206
hasSnapshotSelection
321c1729db5b initial checkin
penk
parents:
diff changeset
  9207
321c1729db5b initial checkin
penk
parents:
diff changeset
  9208
    ^ [ 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9209
        | files |
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9210
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9211
        files := self currentSelectedFiles.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9212
        ((files size == 1)
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9213
        and:[ files first hasSuffix:'img' ])
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9214
      ]
321c1729db5b initial checkin
penk
parents:
diff changeset
  9215
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9216
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9217
hasXml
9206
7ed728324dbf changed: #hasXml
Claus Gittinger <cg@exept.de>
parents: 9173
diff changeset
  9218
    ^ [ XML::XMLParser notNil ]
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9219
!
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9220
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9221
hasXmlFileSelected
8611
3d979ab577b7 xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents: 8601
diff changeset
  9222
    "/ 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
  9223
    "/ 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
  9224
8426
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9225
    ^ [
3adb5c1f5a70 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8364
diff changeset
  9226
        |sel fileName|
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9227
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9228
        sel := self currentSelectedFiles.
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9229
        sel size == 1 ifTrue:[
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9230
            fileName := sel first.
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9231
            fileName notNil ifTrue:[
15936
4d0368c047f5 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15915
diff changeset
  9232
                #('xml' 'xsd' 'vdx') includes:fileName suffix asLowercase
7869
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9233
            ] ifFalse:[
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9234
                false
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9235
            ]
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9236
        ] ifFalse:[
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9237
            false
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9238
        ]
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9239
      ]
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9240
!
eeb3c47f1c62 Menu entry to parse XML file
Stefan Vogel <sv@exept.de>
parents: 7841
diff changeset
  9241
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9242
hasZipFileSelected
17982
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9243
    |sel fileName suff mime|
9764
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9244
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9245
    sel := self currentSelectedFiles.
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9246
    sel size == 1 ifFalse:[^ false].
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9247
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9248
    fileName := sel first.
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9249
    fileName isNil ifTrue:[^ false].
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9250
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9251
    suff := fileName suffix asLowercase.
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9252
    (suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true].
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9253
17982
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9254
    mime := fileName mimeTypeOfContents.
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9255
    "/ prepare for change (iana has obsoleted the x- types)
d8e7e6e78525 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17979
diff changeset
  9256
    ^ (mime = 'application/x-zip-compressed') or:[mime = 'application/zip']
9764
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9257
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9258
    "Modified: / 14-02-2011 / 17:17:03 / cg"
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9259
!
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9260
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9261
hasZipFileSelectedHolder
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9262
    ^ [ self hasZipFileSelected ]
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9263
47b9c33465a1 added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents: 9752
diff changeset
  9264
    "Created: / 14-02-2011 / 17:16:08 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9265
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9266
321c1729db5b initial checkin
penk
parents:
diff changeset
  9267
javaSupportLoaded
321c1729db5b initial checkin
penk
parents:
diff changeset
  9268
321c1729db5b initial checkin
penk
parents:
diff changeset
  9269
    ^ false
321c1729db5b initial checkin
penk
parents:
diff changeset
  9270
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9271
14126
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  9272
454c06ae7055 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14049
diff changeset
  9273
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9274
!AbstractFileBrowser methodsFor:'presentation'!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9275
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9276
getModeString:modeBits
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9277
    "convert file-mode bits into a more user-friendly string.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9278
     This is wrong here - should be moved into OperatingSystem."
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9279
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9280
    ^ self getModeString:modeBits 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9281
                    with:#( 'owner:' $r $w $x 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9282
                            ' group:' $r $w $x 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9283
                            ' others:' $r $w $x )
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9284
!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9285
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9286
getModeString:modeBits with:texts
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9287
    "convert file-mode bits into a more user-friendly string.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9288
     This is wrong here - should be moved into OperatingSystem."
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9289
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9290
    |bits modeString|
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9291
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9292
    bits := modeBits bitAnd:8r777.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9293
    modeString := ''.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9294
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9295
    #( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) 
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9296
    with: texts do:[:bitMask :access |
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9297
        |ch|
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9298
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9299
        bitMask isNil ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9300
            modeString := modeString , access
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9301
        ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9302
            (bits bitAnd:bitMask) == 0 ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9303
                ch := $-
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9304
            ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9305
                ch := access
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9306
            ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9307
            modeString := modeString copyWith:ch 
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9308
        ]
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9309
    ].
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9310
    ^ modeString
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9311
! !
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9312
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9313
!AbstractFileBrowser methodsFor:'private'!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9314
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9315
theSingleSelectedDirectoryOrHomeDir
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9316
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9317
5888
f2758e87cb4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5883
diff changeset
  9318
    dir := self theSingleSelectedDirectoryOrNil.
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9319
    dir isNil ifTrue:[ dir := Filename homeDirectory].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9320
    ^ dir.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9321
!
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9322
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9323
theSingleSelectedDirectoryOrNil
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9324
    |dirs|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9325
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9326
    dirs := self currentSelectedDirectories.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9327
    dirs size ~= 1 ifTrue:[ ^ nil].
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9328
    ^ dirs anElement.
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9329
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9330
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9331
theSingleSelectedFileOrNil
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9332
    |dirs|
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9333
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9334
    dirs := self currentSelectedFiles.
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9335
    dirs size ~= 1 ifTrue:[ ^ nil].
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9336
    ^ dirs anElement.
18751
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9337
!
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9338
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9339
theSingleSelectedItemOrNil
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9340
    |items|
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9341
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9342
    items := self selectedItems.
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9343
    items size ~= 1 ifTrue:[ ^ nil].
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9344
    ^ items anElement.
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9345
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9346
    "Created: / 02-05-2019 / 18:53:06 / Claus Gittinger"
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9347
! !
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9348
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9349
!AbstractFileBrowser methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9350
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9351
cBrowserLoaded
18432
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9352
    ^ (Smalltalk at:#'CBrowser::Browser') notNil
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9353
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9354
    "Modified: / 26-09-2018 / 12:06:32 / Claus Gittinger"
8256
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9355
!
eca8cc20d16c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8253
diff changeset
  9356
10747
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9357
cBrowserMenuItemVisible
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9358
    ^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ]
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9359
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9360
    "Created: / 04-10-2011 / 13:40:38 / cg"
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9361
!
aa57b76e8318 added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents: 10678
diff changeset
  9362
5334
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9363
getAllFilesAsStrings
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9364
    "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
  9365
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9366
    ^ self subclassResponsibility
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9367
!
637f49d94b1b move file(s) operation added
Claus Gittinger <cg@exept.de>
parents: 5318
diff changeset
  9368
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9369
getFileInfoStringForFirstSelectedFile:longInfo
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9370
    "get stat info on selected file - return a string which can be
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9371
     shown in a box"
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9372
5973
0baf6c6b685f #linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents: 5971
diff changeset
  9373
    |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
  9374
     sizeString fileSize tAccess tModification buffer|
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9375
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9376
    selFiles := self currentSelectedObjects.
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9377
    selFiles size ~~ 1 ifTrue:[ ^ nil].
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9378
    filename := selFiles first.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9379
8364
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9380
    info := filename linkInfo.
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9381
    info isNil ifTrue:[
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9382
        ^ 'Cannot get fileInfo'.
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9383
        ^ nil
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9384
    ].
8364
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9385
5755
5e8165d55605 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 5753
diff changeset
  9386
    buffer := Text writeStream.
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9387
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9388
    buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9389
        nextPutAll:'filename: '; 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9390
        nextPutLine:filename asString.
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9391
8364
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9392
    OperatingSystem isMSDOSlike ifTrue: [
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9393
        (info alternativeName notNil
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9394
        and:[ info alternativeName ~= info fullName ]) ifTrue:[
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9395
            buffer nextPutAll:'shortname: '.
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9396
            buffer nextPutLine:info alternativeName.
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9397
        ]
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9398
    ].
29410508a0f5 show the alternative name in the property box
ca
parents: 8355
diff changeset
  9399
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9400
    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
  9401
    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
  9402
        filename exists ifFalse:[
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9403
            buffer nextPutAll:'broken '.
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9404
        ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9405
        buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9406
            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
  9407
            nextPutLine:(info path ? '???').
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9408
    ] 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
  9409
        (longInfo and:[info isRegular]) ifTrue:[
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9410
            fileOutput := filename fileType.
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9411
        ].
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9412
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9413
        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
  9414
            s := info type asString
5360
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9415
        ] ifFalse:[
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9416
            s := 'regular (' , fileOutput , ')'
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9417
        ].
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9418
        buffer nextPutLine:s.
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9419
    ].
1f2f874c8c9a avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents: 5356
diff changeset
  9420
4707
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9421
    fileSize := info fileSize.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9422
    sizeString := 'size:   ', fileSize printString.
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9423
    longInfo ifTrue:[
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9424
        fileSize > 1024  ifTrue:[
8172
71054e80bac7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8168
diff changeset
  9425
            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
  9426
        ].
e0a527ba0898 show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents: 4692
diff changeset
  9427
    ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9428
    buffer nextPutLine:sizeString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9429
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9430
    modeBits := info mode.
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9431
    modeString := self getModeString:modeBits.
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9432
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9433
    buffer nextPutAll:'access: '; nextPutAll:modeString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9434
    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
  9435
        buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$).
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9436
    ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9437
    buffer
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9438
        cr;
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9439
        nextPutAll:'owner:  ';
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9440
        nextPutLine:(OperatingSystem getUserNameFromID:(info uid)).
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9441
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9442
    longInfo ifTrue:[
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9443
        buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9444
            nextPutAll:'group:  ';
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9445
            nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)).
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9446
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9447
        tAccess := info accessTime.
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9448
        buffer 
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9449
            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
  9450
            nextPutAll:tAccess asDate printString; 
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9451
            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
  9452
            nextPutLine:tAccess asTime printString.
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9453
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9454
        tModification := info modificationTime.
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9455
        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
  9456
            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
  9457
            nextPutAll:tModification asDate printString; 
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9458
            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
  9459
            nextPutLine:tModification asTime printString.
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9460
    ].
4765
da557dd8bf69 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4755
diff changeset
  9461
    ^ buffer contents
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9462
7633
0a85c590f98f ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents: 7585
diff changeset
  9463
    "Modified: / 07-02-2007 / 10:38:14 / cg"
3906
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9464
!
8a76cb4f5884 next stage
penk
parents: 3892
diff changeset
  9465
8510
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9466
hasImageColorHistogram
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9467
    ^ ImageColorHistogram notNil
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9468
!
a21c9accd3cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8490
diff changeset
  9469
17686
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9470
hasImageHistogram
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9471
    ^ ImageAlgorithms notNil
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9472
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9473
    "Created: / 10-09-2017 / 16:50:34 / cg"
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9474
!
c6fc2da19287 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17582
diff changeset
  9475
10258
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9476
hasSubversionSupport
11156
11c0b4cbc836 Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents: 11149
diff changeset
  9477
    ^ ConfigurableFeatures includesFeature: #SubversionSupport
10258
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9478
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9479
    "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
  9480
    "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
  9481
    "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
  9482
!
7d2454c716de Merged with JV's branch
vrany
parents: 9945
diff changeset
  9483
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9484
initialCommandFor:fileName into:aBox
321c1729db5b initial checkin
penk
parents:
diff changeset
  9485
    "set a useful initial command for execute box."
321c1729db5b initial checkin
penk
parents:
diff changeset
  9486
18734
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  9487
    self class 
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  9488
        initialCommandFor:fileName 
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  9489
        in:self "Filename" currentDirectory 
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  9490
        intoBox:aBox
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  9491
ffbafcfcccf1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18666
diff changeset
  9492
    "Modified: / 10-04-2019 / 05:55:21 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9493
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9494
321c1729db5b initial checkin
penk
parents:
diff changeset
  9495
isAbstractFileBrowser
321c1729db5b initial checkin
penk
parents:
diff changeset
  9496
321c1729db5b initial checkin
penk
parents:
diff changeset
  9497
    ^ true
321c1729db5b initial checkin
penk
parents:
diff changeset
  9498
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9499
18432
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9500
stxgdbLoaded
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9501
    ^ (Smalltalk at:#GDBApplication) notNil
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9502
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9503
    "Created: / 26-09-2018 / 12:06:23 / Claus Gittinger"
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9504
!
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9505
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9506
stxgdbMenuItemVisible
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9507
    ^ self stxgdbLoaded or:[ OperatingSystem getLoginName = 'cg' ]
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9508
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9509
    "Created: / 26-09-2018 / 12:05:45 / Claus Gittinger"
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9510
!
cd3ec19afe61 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18426
diff changeset
  9511
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9512
systemIsDOS
321c1729db5b initial checkin
penk
parents:
diff changeset
  9513
    ^ OperatingSystem isMSDOSlike
321c1729db5b initial checkin
penk
parents:
diff changeset
  9514
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9515
12473
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9516
systemIsOSX
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9517
    ^ OperatingSystem isOSXlike
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9518
!
cbdb0b046e1b class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12426
diff changeset
  9519
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9520
systemIsUnix
321c1729db5b initial checkin
penk
parents:
diff changeset
  9521
    ^ OperatingSystem isUNIXlike
14980
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9522
!
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9523
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9524
systemSupportsVolumes
1c752103f217 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14941
diff changeset
  9525
    ^ OperatingSystem supportsVolumes
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9526
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9527
321c1729db5b initial checkin
penk
parents:
diff changeset
  9528
!AbstractFileBrowser methodsFor:'queries-file'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9529
321c1729db5b initial checkin
penk
parents:
diff changeset
  9530
allItemsOfCurrentDirectory
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9531
    self 
4774
5119967dbd89 code cleanup
Claus Gittinger <cg@exept.de>
parents: 4773
diff changeset
  9532
        applicationNamed:#DirectoryContentsBrowser 
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9533
        ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9534
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9535
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9536
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9537
321c1729db5b initial checkin
penk
parents:
diff changeset
  9538
anyFilesPresentWithSuffix:suffix
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  9539
    self currentSelectedDirectories do:[:dir|
4636
08b2b63e3107 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 4629
diff changeset
  9540
        [
5810
4661bf4c3bbf openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents: 5789
diff changeset
  9541
            (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
  9542
        ] on:FileStream openErrorSignal do:[:ex|].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9543
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9544
    ^ false.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9545
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9546
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9547
commonPrefixOfSelectedFiles
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9548
    |selFiles stringCol firstPre|
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9549
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9550
    selFiles := self currentSelectedObjects.
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9551
    selFiles isEmpty ifTrue:[^ nil].
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9552
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9553
    stringCol := selFiles collect:#asString.
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9554
    firstPre := stringCol at:1.
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9555
    stringCol from:2 do:[:el|
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9556
         firstPre := firstPre commonPrefixWith:el.
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9557
    ].
4773
cb614f80815a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4772
diff changeset
  9558
    ^ firstPre asFilename
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9559
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9560
    "Modified: / 04-12-2006 / 13:14:25 / cg"
4771
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9561
!
9290fdb65a5d #getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents: 4769
diff changeset
  9562
12481
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9563
compressTabsOnSave
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9564
    "if true, compress leading spaces (multiples of 8) with a tab character
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9565
     when saving.
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9566
     Default is true"
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9567
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9568
    ^ true
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9569
!
8cff01f9f552 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12473
diff changeset
  9570
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9571
currentFilesAreInSameDirectory
321c1729db5b initial checkin
penk
parents:
diff changeset
  9572
4881
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9573
    ^ self parentDirectoriesOfCurrentFiles size < 2
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9574
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9575
321c1729db5b initial checkin
penk
parents:
diff changeset
  9576
currentFilesHasDirectories
321c1729db5b initial checkin
penk
parents:
diff changeset
  9577
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  9578
    ^ self currentSelectedDirectories notEmpty.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9579
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9580
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9581
directoriesForFiles:aFileCol
11743
acb7245e126b changed:
Stefan Vogel <sv@exept.de>
parents: 11712
diff changeset
  9582
     ^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set.
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9583
!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9584
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9585
fileListIsEmpty
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9586
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9587
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9588
        ifPresentDo:[:appl | ^ appl fileListIsEmpty].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9589
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9590
    ^ nil.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9591
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9592
321c1729db5b initial checkin
penk
parents:
diff changeset
  9593
fileListIsNotEmpty
321c1729db5b initial checkin
penk
parents:
diff changeset
  9594
321c1729db5b initial checkin
penk
parents:
diff changeset
  9595
    ^ self fileListIsEmpty not.   
321c1729db5b initial checkin
penk
parents:
diff changeset
  9596
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9597
321c1729db5b initial checkin
penk
parents:
diff changeset
  9598
fileName:aFilename1 startsWith:aFilename2
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9599
    " check if aFilename2 is a prefix of aFilename1"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9600
321c1729db5b initial checkin
penk
parents:
diff changeset
  9601
    | file1 file2 |
321c1729db5b initial checkin
penk
parents:
diff changeset
  9602
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9603
    (aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9604
    file1 := aFilename1 asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9605
    file2 := aFilename2 asFilename.
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9606
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9607
    file2 isRootDirectory ifTrue:[ ^ true].
6284
cf7d9fccade1 comments
Claus Gittinger <cg@exept.de>
parents: 6281
diff changeset
  9608
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9609
    ((file1 isDirectory) 
321c1729db5b initial checkin
penk
parents:
diff changeset
  9610
    and:[(file2 isDirectory)
321c1729db5b initial checkin
penk
parents:
diff changeset
  9611
    and:[file1 directory = file2 directory]]) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9612
        ^ file1 baseName = file2 baseName
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9613
    ].
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9614
    ^ (file1 pathName) startsWith:(file2 pathName)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9615
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9616
321c1729db5b initial checkin
penk
parents:
diff changeset
  9617
getAllFilesAsStringCollection
5009
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9618
    self 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9619
        applicationNamed:#DirectoryContentsBrowser 
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9620
        ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection].
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9621
badffb8e7d06 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5003
diff changeset
  9622
    ^ nil
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9623
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9624
321c1729db5b initial checkin
penk
parents:
diff changeset
  9625
getBestDirectory
17868
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  9626
    "from a set of directories, return the common parent directory"
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  9627
fa8c5a7bef99 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17865
diff changeset
  9628
    ^ self class getBestDirectoryFrom:(self currentSelectedDirectories)
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9629
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9630
321c1729db5b initial checkin
penk
parents:
diff changeset
  9631
getDirWithoutFileName:aFileName
321c1729db5b initial checkin
penk
parents:
diff changeset
  9632
321c1729db5b initial checkin
penk
parents:
diff changeset
  9633
    | dir |
321c1729db5b initial checkin
penk
parents:
diff changeset
  9634
    aFileName isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9635
        ^ aFileName.    
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9636
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9637
    dir := aFileName asFilename.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9638
    dir isDirectory ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9639
        dir := dir directory.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9640
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9641
    ^ dir.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9642
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9643
321c1729db5b initial checkin
penk
parents:
diff changeset
  9644
getInfoItem
321c1729db5b initial checkin
penk
parents:
diff changeset
  9645
    "get filename of a description-file (.dir.info, README etc.);
16778
dbbfdadc87a8 #OTHER by mawalch
mawalch
parents: 16732
diff changeset
  9646
     This file is automatically shown when a directory is entered.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9647
     You can add more names below if you like."
321c1729db5b initial checkin
penk
parents:
diff changeset
  9648
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9649
    |dir|
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9650
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9651
    dir := self theSingleSelectedDirectoryOrNil.
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9652
    dir isNil ifTrue:[ ^ nil].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9653
16778
dbbfdadc87a8 #OTHER by mawalch
mawalch
parents: 16732
diff changeset
  9654
    #(
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9655
       '.dir.info'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9656
       'README'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9657
       'ReadMe'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9658
       'Readme'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9659
       'readme'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9660
       'read.me'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9661
       'Read.me'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9662
       'READ.ME'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9663
       'README.TXT'
15915
08316e965232 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15910
diff changeset
  9664
       'README.txt'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9665
       'readme.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9666
       'Readme.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9667
       'Info.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9668
       'info.txt'
321c1729db5b initial checkin
penk
parents:
diff changeset
  9669
       'INFO.TXT'
15915
08316e965232 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 15910
diff changeset
  9670
       'INFO.txt'
16778
dbbfdadc87a8 #OTHER by mawalch
mawalch
parents: 16732
diff changeset
  9671
    ) do:[:f |
5883
a13bd841136b dir declaration error in getInfoItem
penk
parents: 5880
diff changeset
  9672
        |n|
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9673
5880
b2b345e219bf +execute script
Claus Gittinger <cg@exept.de>
parents: 5870
diff changeset
  9674
        n := dir construct:f.
18453
e20ac933ee00 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 18433
diff changeset
  9675
        (n isReadable and:[n isRegularFile]) ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9676
            ^ DirectoryContentsBrowser itemClass fileName:n
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9677
        ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9678
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9679
    ^ nil
4881
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9680
!
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9681
12497
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9682
hasPackageDirectorySelected
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9683
    |dir|
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9684
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9685
    dir := self currentDirectory.
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9686
    ^  dir notNil
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9687
    and:[ dir exists
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9688
    and:[ (dir / 'abbrev.stc') exists ]]
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9689
!
216e10b026ab class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12493
diff changeset
  9690
4881
e6fc72aac6e6 multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents: 4880
diff changeset
  9691
parentDirectoriesOfCurrentFiles
11743
acb7245e126b changed:
Stefan Vogel <sv@exept.de>
parents: 11712
diff changeset
  9692
    ^ self currentSelectedObjects 
acb7245e126b changed:
Stefan Vogel <sv@exept.de>
parents: 11712
diff changeset
  9693
        collect:[:file | file directory] as:Set
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9694
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9695
    "Modified: / 04-12-2006 / 13:15:21 / cg"
6521
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  9696
!
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  9697
6f55c8f06c1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6482
diff changeset
  9698
recursiveAnyFilesPresentWithSuffix:suffix
6652
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9699
    ^ 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
  9700
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9701
"/    |directories|
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9702
"/
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9703
"/    directories := self currentDirectories value.
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9704
"/    directories do:[:dir|
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9705
"/        [
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9706
"/            dir recursiveDirectoryContentsDo:[:f |
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9707
"/                (f asFilename suffix = suffix) ifTrue:[ ^ true]
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9708
"/            ]
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9709
"/        ] on:FileStream openErrorSignal do:[:ex|].
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9710
"/    ].
abde6585a001 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6651
diff changeset
  9711
"/    ^ false.
6586
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9712
!
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9713
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9714
recursiveAnySTFilesPresent
e4eb50529f4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6551
diff changeset
  9715
    ^ self recursiveAnyFilesPresentWithSuffix:'st'
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9716
! !
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9717
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9718
!AbstractFileBrowser methodsFor:'selection'!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9719
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9720
currentSelectedDirectories
6725
3885523e54b8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6708
diff changeset
  9721
    ^ self currentDirectoriesValue.
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9722
!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9723
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9724
currentSelectedFiles
17865
30a8ebe0a1a5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17849
diff changeset
  9725
    ^ self currentSelectedObjects reject:#isDirectory.
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9726
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9727
    "Modified: / 04-12-2006 / 13:14:39 / cg"
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9728
!
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9729
6460
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9730
currentSelectedObjects
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9731
    ^ self currentFileNameHolder value 
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9732
!
62fb687b0e87 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6456
diff changeset
  9733
3982
fc30449d705d *** empty log message ***
penk
parents: 3980
diff changeset
  9734
firstSelectedFile
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9735
    ^ self currentSelectedObjects 
12102
9512a4336434 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12094
diff changeset
  9736
        detect:[:file | (file ? '') asFilename isDirectory not]
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9737
        ifNone:[].
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9738
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9739
    "Modified: / 04-12-2006 / 13:14:50 / cg"
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9740
!
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9741
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9742
hasOnlyDirectoriesSelected
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9743
    ^ self currentSelectedObjects conform:[:file | file isDirectory].
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9744
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9745
    "Created: / 20-05-2010 / 10:45:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9746
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9747
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9748
hasOnlyFilesSelected
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9749
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9750
    ^ self currentSelectedObjects conform:[:file | file isDirectory not].
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9751
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9752
    "Modified: / 04-12-2006 / 13:15:01 / cg"
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9753
!
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9754
9490
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9755
hasTwoDirectoriesSelected
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9756
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9757
    ^ self currentSelectedObjects size == 2 
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9758
        and:[self hasOnlyDirectoriesSelected]
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9759
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9760
    "Created: / 20-05-2010 / 10:45:18 / cg"
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9761
!
Claus Gittinger <cg@exept.de>
parents: 9455
diff changeset
  9762
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9763
hasTwoFilesSelected
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9764
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9765
    ^ self currentSelectedObjects size == 2 
5374
c654db6e8c37 Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents: 5366
diff changeset
  9766
        and:[self hasOnlyFilesSelected]
7560
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9767
7fc383050360 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7533
diff changeset
  9768
    "Modified: / 04-12-2006 / 13:15:04 / cg"
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9769
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9770
18751
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9771
selectFiles:aCollectionOfFiles
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9772
    self subclassResponsibility
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9773
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9774
    "Created: / 02-05-2019 / 18:40:04 / Claus Gittinger"
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9775
!
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9776
14577
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9777
selectNextFile
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9778
    self 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9779
        applicationNamed:#DirectoryContentsBrowser 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9780
        ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectNextFile ]].
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9781
!
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9782
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9783
selectPreviousFile
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9784
    self 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9785
        applicationNamed:#DirectoryContentsBrowser 
1eb708c12e05 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14551
diff changeset
  9786
        ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectPreviousFile ]].
18751
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9787
!
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9788
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9789
selectedItems
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9790
    self subclassResponsibility
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9791
387323a6f3b4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18747
diff changeset
  9792
    "Created: / 02-05-2019 / 21:27:38 / Claus Gittinger"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9793
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9794
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9795
!AbstractFileBrowser methodsFor:'sorting'!
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9796
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9797
currentSortOrder
17790
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9798
    ^ self 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9799
        aspectFor:#currentSortOrder 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9800
        ifAbsent:[ 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9801
            (Dictionary new
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9802
                at:#column put:nil;
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9803
                at:#reverse put:false;
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9804
                at:#sortCaseless put:false;
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9805
                yourself
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9806
            ) asValue 
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9807
        ].
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9808
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9809
    "Modified: / 25-11-2017 / 17:43:00 / cg"
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9810
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9811
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9812
sortBlockHolder
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9813
    ^ self aspectFor:#sortBlockHolder ifAbsent:[
5383
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9814
        (FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9815
                    selector:#fileName 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9816
                    sortCaseless:self sortCaseless value 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9817
                    sortReverse:false) asValue.
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9818
    ].
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9819
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9820
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9821
sortBlockProperty
6785
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9822
    |v|
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9823
    
6785
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9824
    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
  9825
    v addDependent:self.
cac8107d889c clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents: 6767
diff changeset
  9826
    ^ v.
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9827
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9828
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9829
sortCaseless
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  9830
    " aspect for sort caseless "
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9831
13000
e3df0150a620 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12972
diff changeset
  9832
    ^ self 
e3df0150a620 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12972
diff changeset
  9833
        aspectFor:#sortCaseless 
e3df0150a620 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 12972
diff changeset
  9834
        ifAbsent:[ (Filename isCaseSensitive not) asValue ]
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9835
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9836
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9837
sortDirectoriesBeforeFiles
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9838
4201
be512c7e5ea8 save all aspects in Userpreferences now
penk
parents: 4191
diff changeset
  9839
    " aspect for sort directories always before files"
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9840
    ^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ].
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9841
!
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9842
3989
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9843
sortFileListsBy:instanceName 
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9844
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9845
    self sortFileListsBy:instanceName withReverse:true
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9846
!
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9847
7eec3cb5bce6 selectedFiles method name changed
penk
parents: 3982
diff changeset
  9848
sortFileListsBy:instanceName withReverse:aBoolean
8994
b14c9dd8a662 comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
  9849
    | aSymbol sortCaselessLocal currentSortOrder sorter isReverse|
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9850
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9851
    aSymbol := instanceName asSymbol.
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9852
    self sortBlockProperty setValue:instanceName asSymbol.
4151
950e04fef4ba treeBrowser has his own sort now
penk
parents: 4148
diff changeset
  9853
    sortCaselessLocal := self sortCaseless value.
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9854
    currentSortOrder := self currentSortOrder value.
17790
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9855
7841
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9856
    currentSortOrder isEmptyOrNil ifTrue:[
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9857
        self currentSortOrder value:(currentSortOrder := Dictionary new).
4343
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9858
        currentSortOrder at:#column put:aSymbol.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9859
        currentSortOrder at:#reverse put:false.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9860
        currentSortOrder at:#sortCaseless put:sortCaselessLocal.
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9861
    ] ifFalse:[
4343
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9862
        (currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9863
            "/ sort caseless changed
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9864
            currentSortOrder at:#sortCaseless put:sortCaselessLocal.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9865
        ] ifFalse:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9866
            (currentSortOrder at:#column) = aSymbol ifTrue:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9867
                "/ same column like before - change sort order ifReverse is true
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9868
                aBoolean ifTrue:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9869
                    isReverse := currentSortOrder at:#reverse.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9870
                    currentSortOrder at:#reverse put:(isReverse not).
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9871
                ].
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9872
            ] ifFalse:[
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9873
                "/ another column - remark column
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9874
                currentSortOrder at:#column put:aSymbol.
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9875
            ]
209810452034 checkin from browser
penk
parents: 4337
diff changeset
  9876
        ]
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9877
    ].
4027
c662c75b6bf9 *** empty log message ***
penk
parents: 4024
diff changeset
  9878
    self currentSortOrder changed.
9111
4566dd920e09 changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents: 9108
diff changeset
  9879
5383
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9880
    sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9881
                            selector:instanceName 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9882
                            sortCaseless:sortCaselessLocal 
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9883
                            sortReverse:(currentSortOrder at:#reverse).
ae8a426ef69e use for sorting files the new FileSorter class
penk
parents: 5380
diff changeset
  9884
    self sortBlockHolder value:sorter.
7841
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9885
ea9a45f1cd5e oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents: 7829
diff changeset
  9886
    "Modified: / 18-09-2007 / 09:42:47 / cg"
17790
77ef76b01d6b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17772
diff changeset
  9887
    "Modified (format): / 25-11-2017 / 17:43:31 / cg"
3964
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9888
! !
8697bad1c903 next stage for history
penk
parents: 3963
diff changeset
  9889
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9890
!AbstractFileBrowser methodsFor:'startup & release'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9891
16720
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9892
initializeAspects
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9893
    aspects := IdentityDictionary new.
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9894
    aspects at:#applications put:(IdentityDictionary new).
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9895
!
f83da83ca7c3 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 16538
diff changeset
  9896
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9897
makeDependent
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9898
    self filterModel addDependent:self.            
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9899
    self currentFileNameHolder addDependent:self.
4074
53cef1b0cdfc allow sort without directories always at first
penk
parents: 4071
diff changeset
  9900
    self sortDirectoriesBeforeFiles addDependent:self.
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9901
    self sortCaseless addDependent:self.
4011
73fa35b1963b *** empty log message ***
penk
parents: 4004
diff changeset
  9902
    self showHiddenFiles addDependent:self.
4368
ec625478fad7 remark root and selection for every change in classvar
penk
parents: 4367
diff changeset
  9903
    self rootHolder addDependent:self.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9904
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9905
321c1729db5b initial checkin
penk
parents:
diff changeset
  9906
masterApplication:anApplication
321c1729db5b initial checkin
penk
parents:
diff changeset
  9907
321c1729db5b initial checkin
penk
parents:
diff changeset
  9908
    masterApplication isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9909
        (anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9910
            aspects := anApplication aspects
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9911
        ] ifFalse:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9912
            aspects isNil ifTrue:[
16721
c4ac29c3d146 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 16720
diff changeset
  9913
                self initializeAspects.
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9914
            ]
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9915
        ].
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9916
        self applications at:(self className) put:self.
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9917
"/        self makeDependent.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9918
    ].
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9919
    ^ super masterApplication:anApplication.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9920
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9921
4800
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9922
postBuildWith:aBuilder
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9923
    self makeDependent.
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9924
    super postBuildWith:aBuilder.
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9925
!
56854b83f710 subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 4789
diff changeset
  9926
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9927
postOpenWith:aBuilder
321c1729db5b initial checkin
penk
parents:
diff changeset
  9928
321c1729db5b initial checkin
penk
parents:
diff changeset
  9929
    super postOpenWith:aBuilder.
14655
29c914f5fede class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14604
diff changeset
  9930
    "/ now done for all windowGroups by the group itself
29c914f5fede class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 14604
diff changeset
  9931
    "/ self windowGroup showWaitCursorWhenBusyForMillis:100.
6829
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  9932
3bcad14c59fc wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents: 6785
diff changeset
  9933
    "Modified: / 25-07-2006 / 09:12:45 / cg"
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9934
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9935
321c1729db5b initial checkin
penk
parents:
diff changeset
  9936
!AbstractFileBrowser::Clipboard methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9937
321c1729db5b initial checkin
penk
parents:
diff changeset
  9938
files
321c1729db5b initial checkin
penk
parents:
diff changeset
  9939
    "return the value of the instance variable 'files' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9940
321c1729db5b initial checkin
penk
parents:
diff changeset
  9941
    ^ files
321c1729db5b initial checkin
penk
parents:
diff changeset
  9942
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9943
321c1729db5b initial checkin
penk
parents:
diff changeset
  9944
files:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  9945
    "set the value of the instance variable 'files' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9946
321c1729db5b initial checkin
penk
parents:
diff changeset
  9947
    files := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9948
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9949
321c1729db5b initial checkin
penk
parents:
diff changeset
  9950
method
321c1729db5b initial checkin
penk
parents:
diff changeset
  9951
    "return the value of the instance variable 'method' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9952
321c1729db5b initial checkin
penk
parents:
diff changeset
  9953
    ^ method
321c1729db5b initial checkin
penk
parents:
diff changeset
  9954
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9955
321c1729db5b initial checkin
penk
parents:
diff changeset
  9956
method:something
321c1729db5b initial checkin
penk
parents:
diff changeset
  9957
    "set the value of the instance variable 'method' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9958
321c1729db5b initial checkin
penk
parents:
diff changeset
  9959
    method := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
  9960
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9961
321c1729db5b initial checkin
penk
parents:
diff changeset
  9962
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9963
321c1729db5b initial checkin
penk
parents:
diff changeset
  9964
locked
321c1729db5b initial checkin
penk
parents:
diff changeset
  9965
    "return the value of the instance variable 'locked' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
  9966
321c1729db5b initial checkin
penk
parents:
diff changeset
  9967
    locked isNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9968
        locked := false.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9969
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9970
    ^ locked
321c1729db5b initial checkin
penk
parents:
diff changeset
  9971
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9972
321c1729db5b initial checkin
penk
parents:
diff changeset
  9973
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9974
321c1729db5b initial checkin
penk
parents:
diff changeset
  9975
doIfUnLocked:aBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
  9976
321c1729db5b initial checkin
penk
parents:
diff changeset
  9977
    self locked ifFalse:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9978
        aBlock value.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9979
    ].
321c1729db5b initial checkin
penk
parents:
diff changeset
  9980
!
321c1729db5b initial checkin
penk
parents:
diff changeset
  9981
321c1729db5b initial checkin
penk
parents:
diff changeset
  9982
doLocked:aBlock
321c1729db5b initial checkin
penk
parents:
diff changeset
  9983
321c1729db5b initial checkin
penk
parents:
diff changeset
  9984
    locked  := true.
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9985
    aBlock ensure:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
  9986
        locked := false.
4004
f97168a68093 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  9987
    ]
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9988
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9989
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9990
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
  9991
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9992
defaultHistorySize
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
  9993
    ^ 50
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
  9994
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
  9995
6371
b5dab61da244 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6370
diff changeset
  9996
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'!
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9997
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
  9998
new
6371
b5dab61da244 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6370
diff changeset
  9999
    ^ (super new) initializeHistory.
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10000
! !
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10001
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10002
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'!
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10003
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10004
historySize
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10005
    historySize isNil ifTrue:[^ self class defaultHistorySize].
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10006
    ^ historySize
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10007
!
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10008
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10009
historySize:aNumber
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10010
    historySize := aNumber
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
 10011
! !
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
 10012
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10013
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10014
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10015
addToHistory:aPath
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10016
    | item pathToAdd sep|
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10017
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10018
    pathToAdd := aPath.
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10019
    (pathToAdd endsWith:(sep := Filename separator)) ifTrue:[
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10020
        pathToAdd asFilename isRootDirectory ifFalse:[
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10021
            pathToAdd := pathToAdd copyButLast:(sep asString size).    
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10022
        ]    
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10023
    ].
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10024
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10025
    item := self getItemFor:pathToAdd.
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10026
    self backForwardListAdd:pathToAdd.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10027
    item isNil ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10028
        " not already in history"
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10029
        self size >= self historySize ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10030
            self removeLast.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10031
        ].
7566
3e92cf7a6706 ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents: 7565
diff changeset
 10032
        item := DirectoryHistoryItem path:pathToAdd.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10033
    ] ifFalse:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10034
        "already been there before; move the entry to
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10035
         the beginning, so it will fall out later."
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10036
        self remove:item.
10381
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
 10037
    ].
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
 10038
    self addFirst:item
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
 10039
ad4b61b0b2fd duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents: 10306
diff changeset
 10040
    "Modified: / 24-07-2011 / 07:12:54 / cg"
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10041
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10042
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10043
backForwardListAdd:aPath
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10044
    |pathIndex|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10045
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10046
    pathIndex := backForwardList indexOf:aPath.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10047
    pathIndex == 0 ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10048
        " a new path comes in remove forward paths "
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10049
        (backForwardList size) > backForwardIndex ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10050
            backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size).    
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10051
        ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10052
    ] ifFalse:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10053
        backForwardList remove:aPath.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10054
        pathIndex <= backForwardIndex ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10055
            backForwardIndex := backForwardIndex - 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10056
        ]
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10057
    ].
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10058
    backForwardList add:aPath afterIndex:backForwardIndex.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10059
    backForwardIndex := backForwardIndex + 1.
6369
7b21b4675578 directoryHistory
Claus Gittinger <cg@exept.de>
parents: 6352
diff changeset
 10060
    backForwardIndex > self historySize ifTrue:[
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10061
        backForwardList removeFirst.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10062
        backForwardIndex := backForwardIndex - 1.
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10063
    ].
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10064
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10065
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10066
goBackward
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10067
    "return the first path of the backward list;
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10068
     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
 10069
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10070
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10071
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10072
    self canBackward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10073
        retPath := backForwardList at:(backForwardIndex - 1).
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10074
        backForwardIndex := backForwardIndex - 1.
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10075
    ].
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10076
    ^ retPath.
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10077
!
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10078
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10079
goForward
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10080
    "return the first path of the forward list;
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10081
     remove it from the list."
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10082
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10083
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10084
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10085
    self canForward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10086
        retPath := backForwardList at:backForwardIndex + 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10087
        backForwardIndex := backForwardIndex + 1.
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10088
    ].
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10089
    ^ retPath.
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10090
!
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10091
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10092
resetForwardBackward
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10093
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10094
    self initialize
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10095
!
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10096
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10097
setPosition:aPosition for:aPath
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10098
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10099
    self do:[:item| 
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
 10100
        item path = aPath ifTrue:[
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
 10101
            item position:aPosition.
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
 10102
        ]
4022
87ab8e8c5f80 instable next try for back forward history
penk
parents: 4018
diff changeset
 10103
    ].
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10104
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10105
4870
8e9a999939d3 method category rename
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
 10106
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'!
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
 10107
6371
b5dab61da244 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6370
diff changeset
 10108
initializeHistory
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
 10109
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10110
    backForwardList := OrderedCollection new.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10111
    self reverseDo:[:el|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10112
        backForwardList add:el path.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10113
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10114
    backForwardIndex := backForwardList size.
4032
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
 10115
! !
e19634385525 initialize of backList and forwardList
penk
parents: 4027
diff changeset
 10116
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10117
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10118
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10119
canBackward
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10120
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10121
    ^ backForwardIndex > 1 
4288
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10122
!
1433441aca41 history access
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
 10123
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10124
canForward
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10125
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10126
    ^ (backForwardList size >= (backForwardIndex + 1))
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10127
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10128
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10129
getBackCollection
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10130
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10131
    | backCol |
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10132
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10133
    backCol := OrderedCollection new.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10134
    self canBackward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10135
        | tmpCol |
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10136
        tmpCol := backForwardList copyTo:backForwardIndex - 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10137
        tmpCol reverseDo:[ :el|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10138
            backCol add:el.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10139
        ]
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10140
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10141
    ^ backCol
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10142
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10143
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10144
getForwardCollection
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10145
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10146
    | forwCol |
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10147
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10148
    forwCol := OrderedCollection new.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10149
    self canForward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10150
        forwCol := backForwardList copyFrom:(backForwardIndex + 1)    
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10151
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10152
    ^ forwCol
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10153
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10154
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10155
getItemFor:aPath
6627
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10156
    ^ self detect:[:item| item path = aPath] ifNone:nil.
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10157
"/    self do:[:item| item path = aPath ifTrue:[^ item]].
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10158
"/    ^ nil.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10159
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10160
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10161
getPositionFor:aPath
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10162
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10163
    |item|
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10164
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10165
    item := self getItemFor:aPath.
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10166
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10167
    item notNil ifTrue:[
4414
1c1b24365d26 compare files - incomplete
Claus Gittinger <cg@exept.de>
parents: 4394
diff changeset
 10168
        ^ item position.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10169
    ].
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10170
    ^ nil
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10171
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10172
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10173
includesPath:aPath
6627
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10174
    ^ self contains:[:item | item path = aPath].
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10175
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10176
"/    self do:[:item| item path = aPath ifTrue:[^ true]].
48664e62315f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6602
diff changeset
 10177
"/    ^ false.
4347
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10178
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10179
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10180
nextBackwardItem
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10181
    "return the first path of the backward list"
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10182
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10183
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10184
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10185
    self canBackward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10186
        retPath := backForwardList at:backForwardIndex.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10187
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10188
    ^ retPath.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10189
!
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10190
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10191
nextForwardItem
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10192
    "return the first path of the forward list"
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10193
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10194
    |retPath|
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10195
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10196
    self canForward ifTrue:[
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10197
        retPath := backForwardList at:backForwardIndex + 1.
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10198
    ].
c70ee320b68c history back forward is running now
penk
parents: 4345
diff changeset
 10199
    ^ retPath.
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10200
! !
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10201
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10202
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10203
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10204
path:aPath
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10205
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10206
    ^ self new path:aPath
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10207
! !
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10208
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10209
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10210
6433
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10211
asFilename
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10212
    ^ path asFilename
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10213
!
b90b535c1245 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6388
diff changeset
 10214
3952
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10215
path
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10216
    "return the value of the instance variable 'path' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10217
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10218
    ^ path
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10219
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10220
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10221
path:something
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10222
    "set the value of the instance variable 'path' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10223
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10224
    path := something.
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10225
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10226
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10227
position
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10228
    "return the value of the instance variable 'position' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10229
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10230
    ^ position
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10231
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10232
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10233
position:something
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10234
    "set the value of the instance variable 'position' (automatically generated)"
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10235
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10236
    position := something.
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10237
!
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10238
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10239
printString
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10240
c04d4781a37e next stage
penk
parents: 3949
diff changeset
 10241
    ^ self path asString
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10242
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10243
321c1729db5b initial checkin
penk
parents:
diff changeset
 10244
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10245
321c1729db5b initial checkin
penk
parents:
diff changeset
 10246
withValue:aValue isHolder:aBoolean
321c1729db5b initial checkin
penk
parents:
diff changeset
 10247
321c1729db5b initial checkin
penk
parents:
diff changeset
 10248
    | instance |
321c1729db5b initial checkin
penk
parents:
diff changeset
 10249
321c1729db5b initial checkin
penk
parents:
diff changeset
 10250
    instance := self basicNew.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10251
    instance value:aValue.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10252
    instance isHolder:aBoolean.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10253
    ^ instance
321c1729db5b initial checkin
penk
parents:
diff changeset
 10254
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10255
321c1729db5b initial checkin
penk
parents:
diff changeset
 10256
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10257
321c1729db5b initial checkin
penk
parents:
diff changeset
 10258
isHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
 10259
    "return the value of the instance variable 'isHolder' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10260
321c1729db5b initial checkin
penk
parents:
diff changeset
 10261
    ^ isHolder
321c1729db5b initial checkin
penk
parents:
diff changeset
 10262
!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10263
321c1729db5b initial checkin
penk
parents:
diff changeset
 10264
isHolder:something
321c1729db5b initial checkin
penk
parents:
diff changeset
 10265
    "set the value of the instance variable 'isHolder' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10266
321c1729db5b initial checkin
penk
parents:
diff changeset
 10267
    isHolder := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10268
!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10269
321c1729db5b initial checkin
penk
parents:
diff changeset
 10270
value
321c1729db5b initial checkin
penk
parents:
diff changeset
 10271
    "return the value of the instance variable 'value' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10272
321c1729db5b initial checkin
penk
parents:
diff changeset
 10273
    ^ value
321c1729db5b initial checkin
penk
parents:
diff changeset
 10274
!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10275
321c1729db5b initial checkin
penk
parents:
diff changeset
 10276
value:something
321c1729db5b initial checkin
penk
parents:
diff changeset
 10277
    "set the value of the instance variable 'value' (automatically generated)"
321c1729db5b initial checkin
penk
parents:
diff changeset
 10278
321c1729db5b initial checkin
penk
parents:
diff changeset
 10279
    value := something.
321c1729db5b initial checkin
penk
parents:
diff changeset
 10280
! !
321c1729db5b initial checkin
penk
parents:
diff changeset
 10281
321c1729db5b initial checkin
penk
parents:
diff changeset
 10282
!AbstractFileBrowser class methodsFor:'documentation'!
321c1729db5b initial checkin
penk
parents:
diff changeset
 10283
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
 10284
version
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10285
    ^ '$Header$'
10305
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
 10286
!
58cfe23bd6cd changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents: 10304
diff changeset
 10287
8832
Claus Gittinger <cg@exept.de>
parents: 8808
diff changeset
 10288
version_CVS
15803
c81bf7d45ad0 class: AbstractFileBrowser
Claus Gittinger <cg@exept.de>
parents: 15675
diff changeset
 10289
    ^ '$Header$'
3892
321c1729db5b initial checkin
penk
parents:
diff changeset
 10290
! !
12094
1ac25533a0d3 class: AbstractFileBrowser
Stefan Vogel <sv@exept.de>
parents: 12062
diff changeset
 10291