AbstractDirectoryBrowser.st
author Claus Gittinger <cg@exept.de>
Tue, 22 May 2018 18:52:01 +0200
changeset 18142 d367ddfbb627
parent 17866 6a5f75df356b
child 18214 e7e8fd9c292f
permissions -rw-r--r--
#DOCUMENTATION by cg class: AbstractDirectoryBrowser comment/format in: #postOpenAsSubcanvasWith:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17866
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
     1
"{ Encoding: utf8 }"
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
     2
5139
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     3
"
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     4
 COPYRIGHT (c) 2003 by eXept Software AG
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     5
              All Rights Reserved
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     6
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     7
 This software is furnished under a license and may be used
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     8
 only in accordance with the terms of that license and with the
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    10
 be provided or otherwise made available to, or used by, any
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    11
 other person.  No title to or ownership of the software is
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    12
 hereby transferred.
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    13
"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libtool' }"
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
    16
"{ NameSpace: Smalltalk }"
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
    17
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
AbstractFileBrowser subclass:#AbstractDirectoryBrowser
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:'inDropMode canDropItem browser updateToExternFileHolderLock'
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Interface-Tools-File'
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!AbstractDirectoryBrowser class methodsFor:'documentation'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
5139
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    27
copyright
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    28
"
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    29
 COPYRIGHT (c) 2003 by eXept Software AG
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    30
              All Rights Reserved
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    31
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    32
 This software is furnished under a license and may be used
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    33
 only in accordance with the terms of that license and with the
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    35
 be provided or otherwise made available to, or used by, any
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    36
 other person.  No title to or ownership of the software is
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    37
 hereby transferred.
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    38
"
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    39
!
4cef12eebbb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
    40
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    Abstract class containing the common code from DirectoryTreeBrowser and
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    DirectoryContentsBrowser applications.
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
    45
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
    46
    [Author:]
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
    47
        Christian Penk
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
17289
c695c8f3853e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16946
diff changeset
    51
!AbstractDirectoryBrowser class methodsFor:'queries'!
c695c8f3853e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16946
diff changeset
    52
c695c8f3853e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16946
diff changeset
    53
isAbstract
c695c8f3853e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16946
diff changeset
    54
    ^ self == AbstractDirectoryBrowser
c695c8f3853e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16946
diff changeset
    55
! !
c695c8f3853e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16946
diff changeset
    56
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!AbstractDirectoryBrowser methodsFor:'accessing'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
updateToExternFileHolderLock
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    updateToExternFileHolderLock isNil ifTrue:[
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
        updateToExternFileHolderLock := self class newLock.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    ^ updateToExternFileHolderLock
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
!AbstractDirectoryBrowser methodsFor:'drag & drop'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
7402
a0d38bb3a02e code cleanup
Claus Gittinger <cg@exept.de>
parents: 6590
diff changeset
    68
canDrop:aDropContext
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    ^ inDropMode and:[canDropItem]
7402
a0d38bb3a02e code cleanup
Claus Gittinger <cg@exept.de>
parents: 6590
diff changeset
    70
a0d38bb3a02e code cleanup
Claus Gittinger <cg@exept.de>
parents: 6590
diff changeset
    71
    "Modified: / 13-10-2006 / 11:35:09 / cg"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    74
doDrop:aContext 
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    75
    |col destinationPath receiver didDrop|
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    76
4754
e8ff80bb18ea oops - dropLeave has a side effect.
Claus Gittinger <cg@exept.de>
parents: 4745
diff changeset
    77
    destinationPath := self dropDestinationPath.
e8ff80bb18ea oops - dropLeave has a side effect.
Claus Gittinger <cg@exept.de>
parents: 4745
diff changeset
    78
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    79
    self dropLeave:aContext.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    80
7586
fdeb89d217b2 changed #doDrop:
Claus Gittinger <cg@exept.de>
parents: 7420
diff changeset
    81
    destinationPath isNil ifTrue:[^ self].
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    82
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    83
    aContext dropSource argument == #archivApplication ifTrue:[
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    84
        receiver := aContext dropSource receiver.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    85
        receiver extractSelectedFilesTo:destinationPath askForExtractOptions:true.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    86
        ^ self
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    87
    ].
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    88
9362
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
    89
    self withWaitCursorDo:[
17866
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
    90
        col := aContext dropObjects collect:#theObject.
9362
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
    91
        didDrop := self copyOrMoveFiles:col to:destinationPath.
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
    92
        didDrop ifFalse:[
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
    93
            aContext clearHasDroppedFlagToSuppressFeedBack
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
    94
        ].           
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
    95
    ]
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    96
!
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
    97
5335
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
    98
dropDestinationPath
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
    99
    self subclassResponsibility
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
   100
!
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
   101
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
dropEnter:aContext
6377
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
   103
    |dropObjects|
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    self dropTargetItemChangedTo:nil in:aContext.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
"/    self directory isNil ifTrue:[^ self].
6377
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
   109
    dropObjects := aContext dropObjects.
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   111
    dropObjects do:[:eachDropObject| 
15042
f002aba0f9c9 class: AbstractDirectoryBrowser
Claus Gittinger <cg@exept.de>
parents: 12873
diff changeset
   112
        |checkObject|
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   114
        eachDropObject isFileObject ifFalse:[^ self].
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   116
        checkObject := eachDropObject theObject.
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 5967
diff changeset
   117
        checkObject isFilename ifFalse:[^ self].
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 5967
diff changeset
   118
        (aContext dropSource argument == #archivApplication) ifFalse:[
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
            checkObject isSpecialFile ifTrue:[^ self].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
            checkObject isReadable ifFalse:[^ self].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
        ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    inDropMode := true.
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   124
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   125
    "Modified (format): / 15-11-2017 / 11:10:16 / cg"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
dropLeave:aDropContext 
9328
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   129
    "called, when leaving the widget"
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   130
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    inDropMode ifFalse:[ ^ self ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    self dropTargetItemChangedTo:nil in:aDropContext.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    self removeExpandItemTimedBlock.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
5330
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   138
dropTargetItemChangedTo:anItem in:aContext
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   139
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   140
    self subclassResponsibility
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   141
!
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   142
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
getDropObjects:anArgument
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    ^ self selectedFiles collect:[:file| DropObject newFile:file].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
getLineNumberFor:aDropContext
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    | yVisible|
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    yVisible := (aDropContext targetPoint y).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    ^ browser yVisibleToRowNr:yVisible.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
4802
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   155
pushUserEvent:selector withArgument:argument
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   156
    self window sensor 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   157
        pushUserEvent:selector 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   158
        for:self 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   159
        withArgument:argument
5796
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   160
!
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   161
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   162
removeExpandItemTimedBlock
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   163
    "left blank"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
!AbstractDirectoryBrowser methodsFor:'file actions'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
doCopy
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   169
    "copy the selected files/directories to the clipBoard"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    self copyFilesToClipBoard:(self selectedFiles).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
doCut
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   175
    "cut the selected files/directories to the clipBoard"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    self cutFilesToClipBoard:(self selectedFiles).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
doDelete
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   181
    "delete the selected files/directories"
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
   182
4742
972a9d30ec47 enumerate copies of the selection in delete & rename
Claus Gittinger <cg@exept.de>
parents: 4712
diff changeset
   183
    self deleteFiles:(self selectedFiles copy).
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   184
!
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   185
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   186
doErase
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   187
    "erase the selected files"
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   188
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   189
    self eraseFiles:(self selectedFiles copy).
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
!AbstractDirectoryBrowser methodsFor:'selection'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
selectedFiles
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
17866
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
   196
    ^ self selectedItems collect:#fileName.
16946
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   197
!
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   198
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   199
selectedItems
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   200
    self subclassResponsibility
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
!AbstractDirectoryBrowser methodsFor:'startup & release'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
initialize
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    ^ super initialize.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   211
postOpenAsSubcanvasWith:aBuilder
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   212
    "this is sent after the applications window is opened inside another application.
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   213
     Can be redefined in subclasses for actions after showing the canvas view."
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   214
18142
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   215
    "/ cg: used to be unconditionally true here;
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   216
    "/ but then, when a FileDialog (which is not an AbstractFileBrowser) is opened,
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   217
    "/ the commonPostBuild will not properly update its enable channels;
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   218
    "/ especially the enableDirectoryUp is false.
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   219
    "/ This whole FileBrowser is so complicated that it became almost unusable.
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   220
    "/ (too much inheritance and knowledge - DirTree and DirContents should each only do
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   221
    "/ what it should and not depend on shared functionality from their superclass)
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   222
    self postOpenFromMaster:(self masterApplication class includesBehavior:AbstractFileBrowser).
18142
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   223
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   224
    "Modified (comment): / 22-05-2018 / 18:48:22 / Claus Gittinger"
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   225
!
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   226
5444
02b2cd0dfd69 open treebrowser with empty window bug
penk
parents: 5442
diff changeset
   227
postOpenFromMaster:fromMaster 
5442
4e025f6f8ed7 building not complete in open from master
penk
parents: 5335
diff changeset
   228
    self subclassResponsibility
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   231
postOpenWith:aBuilder
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   232
    "this is sent after the applications main window is opened.
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   233
     Can be redefined in subclasses for actions after opening the view."
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   234
17578
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   235
    super postOpenWith:aBuilder.
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   236
    self postOpenFromMaster:false.
17578
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   237
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   238
    "Modified: / 16-07-2017 / 12:19:48 / cg"
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   239
!
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   240
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
preBuildWith:aBuilder
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    self masterApplication isNil ifTrue:[
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
        self masterApplication:nil.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    ^ super preBuildWith:aBuilder.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
!AbstractDirectoryBrowser class methodsFor:'documentation'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
version
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   252
    ^ '$Header$'
9328
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   253
!
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   254
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   255
version_CVS
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   256
    ^ '$Header$'
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
! !
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   258