AbstractDirectoryBrowser.st
author Stefan Vogel <sv@exept.de>
Fri, 17 May 2019 17:11:44 +0200
changeset 18767 0478d93cdb75
parent 18752 45360c74eb11
child 19011 eb958cb66cfc
permissions -rw-r--r--
#REFACTORING by stefan Sanitize BlockValues class: Tools::Inspector2 changed: #toolbarBackgroundHolder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18750
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
     1
"{ Encoding: utf8 }"
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
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
18281
906957435fec #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18270
diff changeset
    59
directory
906957435fec #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18270
diff changeset
    60
    ^ self subclassResponsibility
906957435fec #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18270
diff changeset
    61
906957435fec #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18270
diff changeset
    62
    "Created: / 23-07-2018 / 12:49:38 / Stefan Vogel"
906957435fec #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18270
diff changeset
    63
!
906957435fec #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 18270
diff changeset
    64
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
updateToExternFileHolderLock
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    updateToExternFileHolderLock isNil ifTrue:[
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
        updateToExternFileHolderLock := self class newLock.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    ^ updateToExternFileHolderLock
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
18270
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
    72
!AbstractDirectoryBrowser methodsFor:'actions'!
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
    73
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
    74
findFilesMatching:aGLOBPattern
18750
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    75
    "search files which match aGLOBPattern.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    76
     If a folder is selected, the search starts there;
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    77
     otherwise in the top folder"
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    78
     
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    79
    |selItem searchDir|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    80
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    81
    (selItem := self theSingleSelectedItemOrNil) notNil ifTrue:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    82
        selItem isDirectory ifTrue:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    83
            searchDir := selItem pathName
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    84
        ] ifFalse:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    85
            searchDir := selItem pathName asFilename directory
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    86
        ].    
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    87
    ] ifFalse:[   
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    88
        searchDir := self directory 
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    89
    ].  
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    90
    ^ self findFilesMatching:aGLOBPattern in:searchDir
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    91
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    92
    "Created: / 17-07-2018 / 12:53:32 / Claus Gittinger"
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    93
    "Modified: / 02-05-2019 / 20:41:57 / Claus Gittinger"
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    94
!
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    95
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    96
findFilesMatching:aGLOBPattern in:searchDir
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    97
    "search files which match aGLOBPattern."
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
    98
     
18270
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
    99
    |matching|
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   100
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   101
    matching := OrderedCollection new.
18750
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   102
    searchDir asFilename recursiveDirectoryContentsAsFilenamesDo:[:each |
18270
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   103
        (aGLOBPattern match:each baseName) ifTrue:[
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   104
            matching add:each
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   105
        ].    
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   106
    ].
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   107
    ^ matching
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   108
18750
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   109
    "Created: / 02-05-2019 / 18:58:30 / Claus Gittinger"
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   110
!
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   111
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   112
findNextFileMatching:aGLOBPattern startingAt:anItemOrNil
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   113
    "search files which match aGLOBPattern."
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   114
     
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   115
    |searchFolder searchIndex stack|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   116
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   117
    stack := OrderedCollection new.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   118
    anItemOrNil isRootItem ifFalse:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   119
        |i|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   120
        
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   121
        i := anItemOrNil.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   122
        [i isRootItem] whileFalse:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   123
            stack addFirst:(i parent -> (i parent children indexOf:i)).
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   124
            i := i parent.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   125
        ].    
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   126
    ].
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   127
    
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   128
    anItemOrNil isDirectory ifTrue:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   129
        searchFolder := anItemOrNil.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   130
        searchIndex := 0.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   131
    ] ifFalse:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   132
        searchFolder := anItemOrNil parent.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   133
        searchIndex := anItemOrNil parent children indexOf:anItemOrNil.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   134
    ].
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   135
    stack add:(searchFolder -> searchIndex).
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   136
    
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   137
    [stack notEmpty] whileTrue:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   138
        |work children|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   139
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   140
        work := stack removeLast.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   141
        searchFolder := work key.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   142
        searchIndex := work value.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   143
        
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   144
        children := searchFolder children.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   145
        searchIndex+1 to:(children size) doWithExit:[:childIndex :exit|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   146
            |child|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   147
            
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   148
            child := children at:childIndex.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   149
Transcript showCR:'search %1' with:child pathName.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   150
            child isDirectory ifFalse:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   151
                (aGLOBPattern match:child baseName) ifTrue:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   152
                    ^ child pathName asFilename
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   153
                ].
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   154
            ] ifTrue:[
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   155
                stack add:(searchFolder -> childIndex).
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   156
                stack add:(child -> 0).
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   157
                exit value:nil.
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   158
            ]
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   159
        ].
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   160
    ].  
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   161
    ^ nil
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   162
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   163
    "Created: / 02-05-2019 / 20:39:58 / Claus Gittinger"
18270
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   164
! !
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   165
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
!AbstractDirectoryBrowser methodsFor:'drag & drop'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
7402
a0d38bb3a02e code cleanup
Claus Gittinger <cg@exept.de>
parents: 6590
diff changeset
   168
canDrop:aDropContext
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    ^ inDropMode and:[canDropItem]
7402
a0d38bb3a02e code cleanup
Claus Gittinger <cg@exept.de>
parents: 6590
diff changeset
   170
a0d38bb3a02e code cleanup
Claus Gittinger <cg@exept.de>
parents: 6590
diff changeset
   171
    "Modified: / 13-10-2006 / 11:35:09 / cg"
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
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   174
doDrop:aContext 
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   175
    |col destinationPath receiver didDrop|
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   176
4754
e8ff80bb18ea oops - dropLeave has a side effect.
Claus Gittinger <cg@exept.de>
parents: 4745
diff changeset
   177
    destinationPath := self dropDestinationPath.
e8ff80bb18ea oops - dropLeave has a side effect.
Claus Gittinger <cg@exept.de>
parents: 4745
diff changeset
   178
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   179
    self dropLeave:aContext.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   180
7586
fdeb89d217b2 changed #doDrop:
Claus Gittinger <cg@exept.de>
parents: 7420
diff changeset
   181
    destinationPath isNil ifTrue:[^ self].
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   182
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   183
    aContext dropSource argument == #archivApplication ifTrue:[
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   184
        receiver := aContext dropSource receiver.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   185
        receiver extractSelectedFilesTo:destinationPath askForExtractOptions:true.
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   186
        ^ self
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   187
    ].
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   188
9362
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
   189
    self withWaitCursorDo:[
17866
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
   190
        col := aContext dropObjects collect:#theObject.
9362
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
   191
        didDrop := self copyOrMoveFiles:col to:destinationPath.
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
   192
        didDrop ifFalse:[
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
   193
            aContext clearHasDroppedFlagToSuppressFeedBack
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
   194
        ].           
5168543f412b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9328
diff changeset
   195
    ]
4745
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   196
!
8082c278087d drop handling
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   197
5335
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
   198
dropDestinationPath
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
   199
    self subclassResponsibility
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
   200
!
c676d4fdd3f5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
   201
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
dropEnter:aContext
6377
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
   203
    |dropObjects|
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    self dropTargetItemChangedTo:nil in:aContext.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
"/    self directory isNil ifTrue:[^ self].
6377
5c3a4c5d70cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6286
diff changeset
   209
    dropObjects := aContext dropObjects.
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   211
    dropObjects do:[:eachDropObject| 
15042
f002aba0f9c9 class: AbstractDirectoryBrowser
Claus Gittinger <cg@exept.de>
parents: 12873
diff changeset
   212
        |checkObject|
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   214
        eachDropObject isFileObject ifFalse:[^ self].
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   216
        checkObject := eachDropObject theObject.
6250
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 5967
diff changeset
   217
        checkObject isFilename ifFalse:[^ self].
5b0673ccff1c refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents: 5967
diff changeset
   218
        (aContext dropSource argument == #archivApplication) ifFalse:[
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
            checkObject isSpecialFile ifTrue:[^ self].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
            checkObject isReadable ifFalse:[^ self].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
        ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    inDropMode := true.
17754
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   224
ccb938c027f8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17578
diff changeset
   225
    "Modified (format): / 15-11-2017 / 11:10:16 / cg"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
dropLeave:aDropContext 
9328
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   229
    "called, when leaving the widget"
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   230
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
    inDropMode ifFalse:[ ^ self ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
    self dropTargetItemChangedTo:nil in:aDropContext.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    self removeExpandItemTimedBlock.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
5330
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   238
dropTargetItemChangedTo:anItem in:aContext
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   239
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   240
    self subclassResponsibility
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   241
!
db3c33306631 drag and drop scrolling
penk
parents: 5139
diff changeset
   242
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
getDropObjects:anArgument
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 selectedFiles collect:[:file| DropObject newFile:file].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
getLineNumberFor:aDropContext
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    | yVisible|
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
18214
e7e8fd9c292f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18142
diff changeset
   251
    yVisible := (aDropContext targetPointInDeviceCoordinates y).
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    ^ browser yVisibleToRowNr:yVisible.
18214
e7e8fd9c292f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18142
diff changeset
   253
e7e8fd9c292f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18142
diff changeset
   254
    "Modified: / 15-06-2018 / 02:32:03 / Claus Gittinger"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
4802
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   257
pushUserEvent:selector withArgument:argument
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   258
    self window sensor 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   259
        pushUserEvent:selector 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   260
        for:self 
681d6bada0bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
   261
        withArgument:argument
5796
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   262
!
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   263
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   264
removeExpandItemTimedBlock
f8f1be919ad4 *** empty log message ***
penk
parents: 5444
diff changeset
   265
    "left blank"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
!AbstractDirectoryBrowser methodsFor:'file actions'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
doCopy
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   271
    "copy the selected files/directories to the clipBoard"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    self copyFilesToClipBoard:(self selectedFiles).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
doCut
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   277
    "cut the selected files/directories to the clipBoard"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
    self cutFilesToClipBoard:(self selectedFiles).
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
doDelete
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   283
    "delete the selected files/directories"
5967
ff5e8356fcb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5903
diff changeset
   284
4742
972a9d30ec47 enumerate copies of the selection in delete & rename
Claus Gittinger <cg@exept.de>
parents: 4712
diff changeset
   285
    self deleteFiles:(self selectedFiles copy).
6286
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   286
!
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   287
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   288
doErase
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   289
    "erase the selected files"
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   290
fac153824f35 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6250
diff changeset
   291
    self eraseFiles:(self selectedFiles copy).
18270
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   292
!
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   293
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   294
findAndSelectFilesMatching:aGLOBPattern
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   295
    self selectFiles:(self findFilesMatching:aGLOBPattern).
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   296
07b44c3ea287 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18214
diff changeset
   297
    "Created: / 17-07-2018 / 12:48:23 / Claus Gittinger"
18750
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   298
!
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   299
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   300
findAndSelectNextFileMatching:aGLOBPattern
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   301
    |fileOrNil|
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   302
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   303
    fileOrNil := self findNextFileMatching:aGLOBPattern 
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   304
                      startingAt:(self theSingleSelectedItemOrNil ? self fileList root).
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   305
    self selectFiles:(fileOrNil isNil 
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   306
                        ifTrue:[#()]
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   307
                        ifFalse:[{ fileOrNil }])
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   308
6be368350a8f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18281
diff changeset
   309
    "Created: / 02-05-2019 / 20:43:41 / Claus Gittinger"
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
!AbstractDirectoryBrowser methodsFor:'selection'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
selectedFiles
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
17866
6a5f75df356b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17754
diff changeset
   316
    ^ self selectedItems collect:#fileName.
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
!AbstractDirectoryBrowser methodsFor:'startup & release'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
initialize
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
    inDropMode := false.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
    ^ super initialize.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   327
postOpenAsSubcanvasWith:aBuilder
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   328
    "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
   329
     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
   330
18142
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   331
    "/ cg: used to be unconditionally true here;
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   332
    "/ but then, when a FileDialog (which is not an AbstractFileBrowser) is opened,
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   333
    "/ 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
   334
    "/ especially the enableDirectoryUp is false.
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   335
    "/ 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
   336
    "/ (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
   337
    "/ 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
   338
    self postOpenFromMaster:(self masterApplication class includesBehavior:AbstractFileBrowser).
18142
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   339
d367ddfbb627 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17866
diff changeset
   340
    "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
   341
!
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   342
5444
02b2cd0dfd69 open treebrowser with empty window bug
penk
parents: 5442
diff changeset
   343
postOpenFromMaster:fromMaster 
5442
4e025f6f8ed7 building not complete in open from master
penk
parents: 5335
diff changeset
   344
    self subclassResponsibility
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   347
postOpenWith:aBuilder
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   348
    "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
   349
     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
   350
17578
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   351
    super postOpenWith:aBuilder.
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   352
    self postOpenFromMaster:false.
17578
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   353
8417ebf871c2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17289
diff changeset
   354
    "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
   355
!
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   356
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
preBuildWith:aBuilder
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
    self masterApplication isNil ifTrue:[
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
        self masterApplication:nil.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
    ].
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
    ^ super preBuildWith:aBuilder.
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
! !
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
!AbstractDirectoryBrowser class methodsFor:'documentation'!
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
version
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   368
    ^ '$Header$'
9328
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   369
!
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   370
1adad8b2c2b7 comment/format
Claus Gittinger <cg@exept.de>
parents: 7586
diff changeset
   371
version_CVS
16912
e57a97280a14 #OTHER by mawalch
mawalch
parents: 15042
diff changeset
   372
    ^ '$Header$'
4712
da798b51457b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
! !
12873
0bf1fc08cfd1 oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents: 9362
diff changeset
   374