AbstractDirectoryBrowser.st
author Claus Gittinger <cg@exept.de>
Fri, 15 Jun 2018 04:00:37 +0200
changeset 18220 d1ebaddf1100
parent 18214 e7e8fd9c292f
child 18270 07b44c3ea287
permissions -rw-r--r--
#UI_ENHANCEMENT by cg class: Tools::CheckinInfoDialog class changed: #windowSpec
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
18214
e7e8fd9c292f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18142
diff changeset
   151
    yVisible := (aDropContext targetPointInDeviceCoordinates y).
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    ^ browser yVisibleToRowNr:yVisible.
18214
e7e8fd9c292f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18142
diff changeset
   153
e7e8fd9c292f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18142
diff changeset
   154
    "Modified: / 15-06-2018 / 02:32:03 / Claus Gittinger"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
4802
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   157
pushUserEvent:selector withArgument:argument
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   158
    self window sensor 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   159
        pushUserEvent:selector 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   160
        for:self 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   161
        withArgument:argument
5796
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   162
!
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   163
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   164
removeExpandItemTimedBlock
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   165
    "left blank"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
!AbstractDirectoryBrowser methodsFor:'file actions'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
doCopy
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   171
    "copy the selected files/directories to the clipBoard"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    self copyFilesToClipBoard:(self selectedFiles).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
doCut
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   177
    "cut the selected files/directories to the clipBoard"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    self cutFilesToClipBoard:(self selectedFiles).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
doDelete
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   183
    "delete the selected files/directories"
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
   184
4742
972a9d30ec47 enumerate copies of the selection in delete & rename
Claus Gittinger <cg@exept.de>
parents: 4712
diff changeset
   185
    self deleteFiles:(self selectedFiles copy).
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   186
!
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   187
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   188
doErase
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   189
    "erase the selected files"
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   190
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   191
    self eraseFiles:(self selectedFiles copy).
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!AbstractDirectoryBrowser methodsFor:'selection'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
selectedFiles
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
17866
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
   198
    ^ self selectedItems collect:#fileName.
16946
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   199
!
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   200
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   201
selectedItems
3684b30ce53e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 16912
diff changeset
   202
    self subclassResponsibility
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
!AbstractDirectoryBrowser methodsFor:'startup & release'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
initialize
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
    ^ super initialize.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   213
postOpenAsSubcanvasWith:aBuilder
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   214
    "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
   215
     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
   216
18142
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   217
    "/ cg: used to be unconditionally true here;
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   218
    "/ but then, when a FileDialog (which is not an AbstractFileBrowser) is opened,
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   219
    "/ 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
   220
    "/ especially the enableDirectoryUp is false.
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   221
    "/ 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
   222
    "/ (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
   223
    "/ 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
   224
    self postOpenFromMaster:(self masterApplication class includesBehavior:AbstractFileBrowser).
18142
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   225
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   226
    "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
   227
!
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   228
5444
02b2cd0dfd69 open treebrowser with empty window bug
penk
parents: 5442
diff changeset
   229
postOpenFromMaster:fromMaster 
5442
4e025f6f8ed7 building not complete in open from master
penk
parents: 5335
diff changeset
   230
    self subclassResponsibility
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   233
postOpenWith:aBuilder
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   234
    "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
   235
     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
   236
17578
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   237
    super postOpenWith:aBuilder.
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   238
    self postOpenFromMaster:false.
17578
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   239
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   240
    "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
   241
!
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   242
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
preBuildWith:aBuilder
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    self masterApplication isNil ifTrue:[
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
        self masterApplication:nil.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    ^ super preBuildWith:aBuilder.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!AbstractDirectoryBrowser class methodsFor:'documentation'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
version
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   254
    ^ '$Header$'
9328
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   255
!
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   256
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   257
version_CVS
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   258
    ^ '$Header$'
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
! !
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   260