FileSelectionList.st
author Stefan Vogel <sv@exept.de>
Wed, 16 May 2018 08:37:31 +0200
changeset 6320 d52325b32f05
parent 6183 0ba0e432ebaa
child 6549 261891fa3b70
permissions -rw-r--r--
#REFACTORING by stefan class: DialogBox class changed: #initialize #modifyingBoxWith:do: fix return value
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     1
"
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
62
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
     3
	      All Rights Reserved
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     4
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c47dbae39a71 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    11
"
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
    12
"{ Package: 'stx:libwidg' }"
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
    13
5589
84ac406042c9 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4711
diff changeset
    14
"{ NameSpace: Smalltalk }"
84ac406042c9 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4711
diff changeset
    15
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    16
SelectionInListView subclass:#FileSelectionList
287
82691623dd4c update fixes
ca
parents: 285
diff changeset
    17
	instanceVariableNames:'pattern directory timeStamp directoryId directoryName
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
    18
		directoryContents directoryFileTypes realAction matchBlock
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
    19
		stayInDirectory ignoreParentDirectory markDirectories
472
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
    20
		ignoreDirectories directoryChangeCheckBlock quickDirectoryChange
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
    21
		directoryChangeAction directorySelectAction fileSelectAction
2377
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
    22
		ignoreFiles directoryHolder directoryStack ignoreCaseInPattern'
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
    23
	classVariableNames:''
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
    24
	poolDictionaries:''
1771
c1bccfce48cd category change
Claus Gittinger <cg@exept.de>
parents: 1690
diff changeset
    25
	category:'Views-Lists'
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    26
!
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    27
1272
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
    28
!FileSelectionList class methodsFor:'documentation'!
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    29
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    30
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    31
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    32
 COPYRIGHT (c) 1993 by Claus Gittinger
62
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
    33
	      All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    34
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    35
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    36
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    38
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    39
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    40
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    41
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    42
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    43
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    44
documentation
c47dbae39a71 Initial revision
claus
parents:
diff changeset
    45
"
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    46
    this class implements file selection lists - its basically a
1272
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
    47
    selection-in-list-view, but adds some right-arrows to directories.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 24
diff changeset
    48
    (and will soon remember the previous position when changing directories).
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    49
    You can specify an optional filename-pattern (such as '*.st') and an
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    50
    optional matchBlock (such as: [:name | name startsWith:'A']).
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    51
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    52
    Only files (plus directories) matching the pattern (if present) and
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    53
    for which the matchBlock returns true (if present), are shown.
21
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
    54
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
    55
    Except for file-browser like applications, FileSelectionLists are almost 
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
    56
    exclusively used with FileSelectionBoxes (see examples there).
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
    57
586
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
    58
    [Instance variables:]
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    59
            pattern                 the matchpattern
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    60
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    61
            directory               the current directory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    62
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    63
            timeStamp               the time, when directoryContents was last taken
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    64
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    65
            directoryId             the directories id (inode-nr) when it was taken
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    66
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    67
            directoryName           the path when it was taken
62
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
    68
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    69
            directoryContents       (cached) contents of current directory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    70
2833
1544bb56f6bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
    71
            directoryFileTypes      (cached) isDirectory-boolean per entry
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    72
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    73
            fileTypes               file types as shown in list (i.e only matching ones)
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    74
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    75
            matchBlock              if non-nil: block evaluated per full filename;
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    76
                                    only files for which matchBlock returns true are shown.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    77
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    78
            realAction              (internal) the action to perform when a file is selected
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    79
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    80
            quickDirectoryChange    if true, directories can be changed with a single click
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    81
                                    if false (the default), they need a double click.
843
20890b1098ce Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 720
diff changeset
    82
                                    Makes sense if a directory is what we are interested in,
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    83
                                    for files its better to leave it as false.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    84
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    85
            stayInDirectory         if true, no directoryChanges are allowed.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    86
                                    Makes sense to limit the user to choose among certain files.    
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    87
                                    The default is false.
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
    88
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    89
            ignoreParentDirectory   if true, the parent directory is not shown.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    90
                                    Makes sense to limit the user to files below the initial
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    91
                                    directory. Default is false.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    92
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    93
            ignoreDirectories       if true, no directories are shown at all.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    94
                                    Makes sense to limit the user to choose among regular files.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    95
                                    Default is false.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
    96
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
    97
            ignoreFiles             if true, no regular files are shown at all.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
    98
                                    Makes sense to limit the user to choose among directories files.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
    99
                                    Default is false.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   100
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   101
            directoryChangeCheckBlock 
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   102
                                    if nonNil, directoryChanges are only allowed if this block
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   103
                                    returns true. It is evaluated with one argument, the pathName.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   104
                                    Defaults to nil (i.e. no checks).
62
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
   105
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   106
            directorySelectAction 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   107
                                    if nonNil, a directory-select evaluate this block.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   108
                                    Possible hook for others (used with Boxes)
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   109
                                    Defaults to nil.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   110
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   111
            fileSelectAction 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   112
                                    if nonNil, file-select evaluate this block.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   113
                                    Possible hook for others (used with Boxes)
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   114
                                    Defaults to nil.
586
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   115
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   116
    [author:]
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   117
        Claus Gittinger
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   118
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   119
    [see also:]
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   120
        DialogBox
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   121
        EnterBox2 YesNoBox
032b3245e53a documentation
Claus Gittinger <cg@exept.de>
parents: 547
diff changeset
   122
        ListSelectionBox FileSelectionBox FileSaveBox 
62
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
   123
"
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
   124
!
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   125
62
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
   126
examples 
7cc1e330da47 *** empty log message ***
claus
parents: 59
diff changeset
   127
"
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   128
    FileSelectionLists are typically used in FileSelectionBoxes,
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   129
    or file-browser-like applications.
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   130
    Thus, the following examples are a bit untypical.
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   131
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   132
    example (plain file-list):
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   133
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   134
        |list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   135
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   136
        list := FileSelectionList new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   137
        list open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   138
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   139
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   140
1331
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   141
    setting a directory holder:
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   142
                                                                        [exBegin]
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   143
        |holder list|
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   144
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   145
        holder := '/etc' asValue.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   146
        list := FileSelectionList new.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   147
        list directoryHolder:holder.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   148
        list open.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   149
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   150
        (EditField on:holder) open.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   151
                                                                        [exEnd]
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   152
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   153
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   154
    scrolled & some action:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   155
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   156
        |top v list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   157
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   158
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   159
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   160
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   161
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   162
        list := v scrolledView.
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   163
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   164
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   165
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   166
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   167
    ignore the parentDirectory:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   168
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   169
        |top v list|
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   170
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   171
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   172
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   173
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   174
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   175
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   176
        list ignoreParentDirectory:true.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   177
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   178
                                                                        [exEnd]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   179
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   180
    ignore all directories (i.e. regular files only):
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   181
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   182
        |top v list|
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   183
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   184
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   185
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   186
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   187
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   188
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   189
        list ignoreDirectories:true.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   190
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   191
                                                                        [exEnd]
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   192
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   193
    ignore all regular files (i.e. directories only):
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   194
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   195
        |top v list|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   196
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   197
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   198
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   199
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   200
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   201
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   202
        list ignoreFiles:true.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   203
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   204
                                                                        [exEnd]
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   205
5589
84ac406042c9 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4711
diff changeset
   206
    don't show the directory arrow-mark:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   207
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   208
        |top v list|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   209
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   210
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   211
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   212
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   213
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   214
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   215
        list markDirectories:false.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   216
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   217
                                                                        [exEnd]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   218
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   219
    adds a pattern, only showing .st files and directories:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   220
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   221
        |top v list|
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   222
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   223
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   224
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   225
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   226
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   227
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   228
        list pattern:'*.st'.
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   229
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   230
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   231
                                                                        [exEnd]
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   232
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   233
    a more complicated pattern:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   234
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   235
        |top v list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   236
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   237
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   238
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   239
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   240
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   241
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   242
        list pattern:'[A-D]*.st'.
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   243
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   244
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   245
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   246
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   247
    adds a matchblock to show only writable files:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   248
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   249
        |top v list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   250
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   251
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   252
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   253
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   254
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   255
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   256
        list matchBlock:[:name | 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   257
                            |fileName|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   258
                            fileName := name asFilename.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   259
                            fileName isWritable or:[fileName isDirectory]
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   260
                        ].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   261
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   262
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   263
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   264
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   265
    adds a matchblock to suppress directories:
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   266
    (this can be done easier with #ignoreDirectories)
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   267
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   268
        |top v list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   269
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   270
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   271
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   272
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   273
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   274
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   275
        list matchBlock:[:name | 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   276
                            name asFilename isDirectory not
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   277
                        ].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   278
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   279
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   280
                                                                        [exEnd]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   281
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   282
    the above can be done more convenient:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   283
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   284
        |top v list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   285
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   286
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   287
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   288
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   289
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   290
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   291
        list ignoreDirectories:true.
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   292
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   293
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   294
                                                                        [exEnd]
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   295
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   296
    adds a matchblock to block parent dirs (i.e. only allow files here & below):
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   297
    (can be done easier with #ignoreParentDirectory)
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   298
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   299
        |top v list currentDir|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   300
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   301
        currentDir := '.' asFilename pathName.
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   302
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   303
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   304
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   305
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   306
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   307
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   308
        list matchBlock:[:name | 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   309
                            ((name endsWith:'/..') and:[list directory pathName = currentDir]) not
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   310
                        ].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   311
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   312
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   313
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   314
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   315
    do not allow changing up AND show all .rc-files only:
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   316
    (but allow going down)
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   317
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   318
        |top v list currentDir|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   319
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   320
        currentDir := '.' asFilename pathName.
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   321
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   322
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   323
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   324
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   325
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   326
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   327
        list pattern:'*.rc'.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   328
        list matchBlock:[:name |  
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   329
                            ((name endsWith:'/..') and:[list directory pathName = currentDir]) not
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   330
                        ].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   331
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   332
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   333
                                                                        [exEnd]
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   334
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   335
    show only .rc-files in current directory:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   336
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   337
        |top v list currentDir|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   338
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   339
        currentDir := '.' asFilename pathName.
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   340
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   341
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   342
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   343
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   344
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   345
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   346
        list pattern:'*.rc'.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   347
        list matchBlock:[:name | 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   348
                            name asFilename isDirectory not
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   349
                        ].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   350
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   351
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   352
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   353
5589
84ac406042c9 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4711
diff changeset
   354
    show only h*-files in /etc; don't allow directory changes:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   355
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   356
        |top v list|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   357
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   358
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   359
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   360
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   361
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   362
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   363
        list directory:'/etc'.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   364
        list pattern:'h*'.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   365
        list matchBlock:[:name | name printNL.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   366
                            name asFilename isDirectory not
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   367
                        ].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   368
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   369
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   370
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   371
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   372
    only allow changing into directories below the current one; i.e. not up;
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   373
    but show it
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   374
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   375
        |top v list here|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   376
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   377
        top := StandardSystemView new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   378
        top extent:(300 @ 200).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   379
        v := ScrollableView for:FileSelectionList in:top.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   380
        v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   381
        list := v scrolledView.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   382
        list directoryChangeCheckBlock:[:dirPath |
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   383
                        dirPath asFilename pathName
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   384
                            startsWith:Filename currentDirectory pathName].
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   385
        list action:[:index | Transcript showCR:'you selected: ' , list selectionValue].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   386
        top open
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   387
                                                                        [exEnd]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   388
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   389
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   390
    living in a box:
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   391
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   392
        |box listView|
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   393
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   394
        box := Dialog new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   395
        box addTextLabel:'which file ?'.
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   396
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   397
        listView := box 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   398
                        addListBoxOn:nil 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   399
                        class:FileSelectionList
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   400
                        withNumberOfLines:10 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   401
                        hScrollable:false 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   402
                        vScrollable:true.
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   403
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   404
        box addAbortButton; addOkButton.
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   405
        box stickAtBottomWithVariableHeight:listView.
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   406
        box open.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   407
        box accepted ifTrue:[
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   408
            Transcript showCR:listView selectedPathname
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   409
        ]
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   410
                                                                        [exEnd]
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   411
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   412
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   413
    living in a box (local files only, no directory change allowed):
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   414
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   415
        |box listView|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   416
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   417
        box := Dialog new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   418
        box addTextLabel:'which file ?'.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   419
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   420
        listView := box 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   421
                        addListBoxOn:nil 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   422
                        class:FileSelectionList
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   423
                        withNumberOfLines:10 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   424
                        hScrollable:false 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   425
                        vScrollable:true.
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   426
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   427
        listView ignoreDirectories:true.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   428
        listView ignoreParentDirectory:true.
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   429
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   430
        box addAbortButton; addOkButton.
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   431
        box stickAtBottomWithVariableHeight:listView.
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   432
        box open.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   433
        box accepted ifTrue:[
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   434
            Transcript showCR:listView selectedPathname
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   435
        ]
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   436
                                                                        [exEnd]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   437
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   438
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   439
    living in a box (local files only; immediately show owner in another field):
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   440
                                                                        [exBegin]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   441
        |box listView lbl|
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   442
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   443
        box := Dialog new.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   444
        box addTextLabel:'which file ?'.
59
450ce95a72a4 *** empty log message ***
claus
parents: 57
diff changeset
   445
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   446
        listView := box 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   447
                        addListBoxOn:nil 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   448
                        class:FileSelectionList
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   449
                        withNumberOfLines:10 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   450
                        hScrollable:false 
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   451
                        vScrollable:true.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   452
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   453
        lbl := box addTextLabel:''.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   454
        lbl adjust:#left.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   455
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   456
        listView fileSelectAction:[:index |
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   457
            |ownerId owner|
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   458
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   459
            ownerId := listView selectedPathname asFilename info at:#uid.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   460
            ownerId == OperatingSystem getUserID ifTrue:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   461
                lbl label:('one of yours').
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   462
            ] ifFalse:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   463
                owner := OperatingSystem getUserNameFromID:ownerId.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   464
                lbl label:(owner , '''s property').
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   465
            ]
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   466
        ].
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   467
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   468
        listView directorySelectAction:[:index |
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   469
            |ownerId owner|
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   470
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   471
            ownerId := listView selectedPathname asFilename info at:#uid.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   472
            ownerId == OperatingSystem getUserID ifTrue:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   473
                lbl label:('your files there').
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   474
            ] ifFalse:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   475
                owner := OperatingSystem getUserNameFromID:ownerId.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   476
                lbl label:(owner , '''s files there').
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   477
            ]    
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   478
        ].
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   479
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   480
        box addAbortButton; addOkButton.
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   481
        box stickAtBottomWithFixHeight:lbl.
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   482
        box stickAtBottomWithVariableHeight:listView.
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   483
        box open.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   484
        box accepted ifTrue:[
655
acad3ef3a46c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   485
            Transcript showCR:listView selectedPathname
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   486
        ]
594
b9c5a5e5f905 examples
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
   487
                                                                        [exEnd]
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
   488
"
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   489
! !
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   490
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   491
!FileSelectionList methodsFor:'accessing-behavior'!
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   492
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   493
action:aBlock
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   494
    "set the action to be performed on a selection"
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   495
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   496
    realAction := aBlock
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   497
!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   498
472
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   499
directoryChangeAction:aBlock
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   500
    "set the action to be performed on a directory change"
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   501
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   502
    directoryChangeAction := aBlock
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   503
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   504
    "Created: 5.3.1996 / 02:37:08 / cg"
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   505
!
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   506
338
ca
parents: 330
diff changeset
   507
directoryChangeCheckBlock:aBlock
ca
parents: 330
diff changeset
   508
    "set the directoryChangeCheckBlock - if non-nil, it controls if
ca
parents: 330
diff changeset
   509
     a directory change is legal."
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   510
338
ca
parents: 330
diff changeset
   511
    directoryChangeCheckBlock := aBlock
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   512
!
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   513
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   514
directorySelectAction:aBlock
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   515
    "set the action to be performed when a directory is selected.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   516
     Useful if someone else wants to show additional information
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   517
     (readable/owner ...) somewhere."
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   518
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   519
    directorySelectAction := aBlock
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   520
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   521
    "Created: 18.4.1996 / 18:45:13 / cg"
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   522
!
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   523
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   524
fileSelectAction:aBlock
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   525
    "set the action to be performed when a file is selected.
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   526
     Useful if someone else wants to show additional information
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   527
     (readable/owner ...) somewhere."
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   528
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   529
    fileSelectAction := aBlock
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   530
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   531
    "Created: 18.4.1996 / 18:45:24 / cg"
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   532
!
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   533
2377
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   534
ignoreCaseInPattern:aBoolean
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   535
    "set/clear the flag which controls if the pattern match is caseless.
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   536
     if it changes, update the list.
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   537
     The default is true for systems, where filenames are caseless (i.e. msdos-based)."
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   538
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   539
    ignoreCaseInPattern ~= aBoolean ifTrue:[
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   540
        ignoreCaseInPattern := aBoolean.
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   541
        realized ifTrue:[
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   542
            self updateList
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   543
        ].
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   544
    ].
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   545
!
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   546
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   547
ignoreDirectories:aBoolean
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   548
    "set/clear the flag which controls if directories are ignored
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   549
     (i.e. hidden). The default is false (i.e. dirs are shown)"
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   550
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   551
    ignoreDirectories := aBoolean
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   552
!
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   553
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   554
ignoreFiles:aBoolean
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   555
    "set/clear the flag which controls if plain files are ignored
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   556
     (i.e. hidden). The default is false (i.e. they are shown)"
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   557
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   558
    ignoreFiles := aBoolean
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   559
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   560
    "Created: 18.4.1996 / 18:48:43 / cg"
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   561
    "Modified: 18.4.1996 / 18:49:23 / cg"
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   562
!
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   563
338
ca
parents: 330
diff changeset
   564
ignoreParentDirectory:aBoolean
ca
parents: 330
diff changeset
   565
    "set/clear the flag which controls if the parent directory (..)
ca
parents: 330
diff changeset
   566
     is shown in the list. The default is false (i.e. show it)"
ca
parents: 330
diff changeset
   567
ca
parents: 330
diff changeset
   568
    ignoreParentDirectory := aBoolean
ca
parents: 330
diff changeset
   569
!
ca
parents: 330
diff changeset
   570
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   571
markDirectories:aBoolean
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   572
    "turn on/off marking of directories with an arrow.
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   573
     The default is on"
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   574
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   575
     markDirectories := aBoolean
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   576
!
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   577
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   578
matchBlock:aBlock
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   579
    "set the matchBlock - if non-nil, it controls which
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   580
     names are shown in the list."
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   581
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   582
    matchBlock := aBlock
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   583
!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   584
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   585
pattern:aPattern
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   586
    "set the pattern - if it changes, update the list."
21
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
   587
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   588
    pattern ~= aPattern ifTrue:[
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   589
	pattern := aPattern.
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   590
	realized ifTrue:[
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   591
	    self updateList
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   592
	].
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   593
    ].
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   594
!
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   595
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   596
quickDirectoryChange:aBoolean
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   597
    "set/clear quick change (i.e. chdir with single click).
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   598
     The default is false (i.e. double click is required)"
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   599
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   600
    quickDirectoryChange := aBoolean
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   601
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   602
    "Created: 4.3.1996 / 17:37:58 / cg"
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   603
!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   604
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   605
stayInDirectory:aBoolean
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   606
    "set/clear the flag which controls if selecting a directory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   607
     should locally change (if false) or be handled just like
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   608
     the selection of a file (if true).
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   609
     The default is false (i.e. change and do not tell via action)"
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   610
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   611
    stayInDirectory := aBoolean
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   612
! !
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   613
1331
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   614
!FileSelectionList methodsFor:'accessing-channels'!
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   615
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   616
directoryHolder:aValueHolder
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   617
    directoryHolder := aValueHolder.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   618
    directoryHolder onChangeSend:#directoryHolderChange to:self.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   619
    self directoryHolderChange
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   620
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   621
    "Modified: 20.9.1997 / 13:16:58 / cg"
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   622
! !
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   623
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   624
!FileSelectionList methodsFor:'accessing-contents'!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   625
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   626
directory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   627
    "return the shown directory"
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   628
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   629
    ^ directory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   630
!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   631
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   632
directory:nameOrDirectory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   633
    "set the lists contents to the filenames in the directory.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   634
     This does not validate the change with any directoryChangeBlock."
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   635
1445
2c717104c3fb dont allow setting wrong directories
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   636
    |oldPath f|
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   637
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   638
    nameOrDirectory isNil ifTrue:[
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   639
        directory := nil.
1331
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   640
        directoryHolder notNil ifTrue:[directoryHolder value:directory].
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   641
        ^ self updateList
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   642
    ].
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   643
    directory notNil ifTrue:[
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   644
        oldPath := directory pathName.
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   645
    ].
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   646
    directory := nameOrDirectory asFilename.
1445
2c717104c3fb dont allow setting wrong directories
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   647
    (directory exists 
2c717104c3fb dont allow setting wrong directories
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   648
    and:[directory isDirectory]) ifFalse:[
2c717104c3fb dont allow setting wrong directories
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   649
        directory := Filename currentDirectory
2c717104c3fb dont allow setting wrong directories
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   650
    ].
1331
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   651
    directoryHolder notNil ifTrue:[directoryHolder value:directory].
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   652
    realized ifTrue:[
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   653
        (directory pathName = oldPath) ifFalse:[
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   654
            self updateList
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   655
        ]
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   656
    ]
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   657
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   658
    "Modified: 18.9.1997 / 23:42:27 / stefan"
1331
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   659
    "Modified: 20.9.1997 / 13:29:02 / cg"
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   660
!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   661
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   662
selectedPathname
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   663
    "if there is a selection, return its full pathname.
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   664
     Of there is no selection, return nil."
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   665
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   666
    |sel|
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   667
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   668
    sel := self selectionValue.
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   669
    sel isNil ifTrue:[^ nil].
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   670
    ^ directory constructString:sel.
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   671
1318
f9091a617af2 filename stuff
Claus Gittinger <cg@exept.de>
parents: 1276
diff changeset
   672
    "Modified: 7.9.1997 / 23:49:01 / cg"
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   673
    "Modified: 18.9.1997 / 23:49:16 / stefan"
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   674
! !
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   675
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   676
!FileSelectionList methodsFor:'drawing'!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   677
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   678
redrawFromVisibleLine:startVisLineNr to:endVisLineNr
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   679
    "redefined to look for directory in every line"
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   680
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   681
    |l|
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   682
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   683
    "first, draw chunk of lines"
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   684
    super redrawFromVisibleLine:startVisLineNr to:endVisLineNr.
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   685
    markDirectories ifFalse:[^ self].
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   686
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   687
    "then draw marks"
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   688
    startVisLineNr to:endVisLineNr do:[:visLineNr |
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   689
        l := self visibleLineToListLine:visLineNr.
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   690
        l notNil ifTrue:[
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   691
            (directoryFileTypes at:l) ifTrue:[
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   692
                self drawRightArrowInVisibleLine:visLineNr
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   693
            ]
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   694
        ]
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   695
    ]
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   696
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   697
    "Modified: / 22.9.1998 / 12:32:24 / cg"
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   698
!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   699
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   700
redrawVisibleLine:visLineNr
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   701
    "if the line is one for a directory, draw a right arrow"
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   702
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   703
    |l|
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   704
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   705
    super redrawVisibleLine:visLineNr.
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   706
    markDirectories ifFalse:[^ self].
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   707
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   708
    l := self visibleLineToListLine:visLineNr.
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   709
    l notNil ifTrue:[
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   710
        (directoryFileTypes at:l) ifTrue:[
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   711
            self drawRightArrowInVisibleLine:visLineNr
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   712
        ]
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   713
    ]
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   714
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   715
    "Modified: / 22.9.1998 / 12:32:34 / cg"
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   716
! !
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   717
329
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   718
!FileSelectionList methodsFor:'events'!
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   719
1331
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   720
directoryHolderChange
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   721
    self directory:directoryHolder value.
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   722
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   723
    "Created: 20.9.1997 / 13:12:45 / cg"
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   724
!
5661f0647ca0 added a valueHolder for the directory.
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   725
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   726
doubleClicked
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   727
    self selectionIsDirectory ifTrue:[
2817
7c82a9535b96 not ifTrue -> ifFalse
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   728
        stayInDirectory ifFalse:[
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   729
            quickDirectoryChange ifFalse:[
472
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   730
                directoryChangeAction notNil ifTrue:[
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   731
                    directoryChangeAction value:self selection
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   732
                ] ifFalse:[
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   733
                    self changeDirectory
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   734
                ]
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   735
            ]
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   736
        ].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   737
        ^ self
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   738
    ].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   739
    super doubleClicked
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   740
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   741
    "Created: 4.3.1996 / 17:39:58 / cg"
472
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   742
    "Modified: 5.3.1996 / 02:38:06 / cg"
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   743
!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   744
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   745
keyPress:key x:x y:y
3224
9dd0891a2ff4 comment
Claus Gittinger <cg@exept.de>
parents: 2913
diff changeset
   746
    "handle cursor-left and cursor-right keys"
9dd0891a2ff4 comment
Claus Gittinger <cg@exept.de>
parents: 2913
diff changeset
   747
9dd0891a2ff4 comment
Claus Gittinger <cg@exept.de>
parents: 2913
diff changeset
   748
    <resource: #keyboard (#CursorLeft #CursorRight)>
9dd0891a2ff4 comment
Claus Gittinger <cg@exept.de>
parents: 2913
diff changeset
   749
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   750
    key == #CursorLeft ifTrue:[
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   751
        self changeToParentDirectory.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   752
        ^ self
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   753
    ].
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   754
    (key == #CursorRight) ifTrue:[
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   755
        self changeToPreviousDirectory.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   756
        ^ self
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   757
    ].
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   758
    super keyPress:key x:x y:y
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   759
!
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   760
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   761
selectionChanged
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   762
    "if the selection changed, check for it being a directory
6105
d643337ff3e6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
   763
     and possibly go there. If it's not a directory, perform the realAction."
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   764
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   765
    self selection isCollection ifFalse:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   766
        self selectionIsDirectory ifTrue:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   767
            (stayInDirectory not and:[quickDirectoryChange]) ifTrue:[
472
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   768
                directoryChangeAction notNil ifTrue:[
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   769
                    directoryChangeAction value:self selection
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   770
                ] ifFalse:[
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   771
                    self changeDirectory
17f795e6ecba added a separate directoryChangeAction
Claus Gittinger <cg@exept.de>
parents: 467
diff changeset
   772
                ]
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   773
            ] ifFalse:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   774
                directorySelectAction notNil ifTrue:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   775
                    directorySelectAction value:self selection
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   776
                ]
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   777
            ]
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   778
        ] ifFalse:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   779
            realAction notNil ifTrue:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   780
                realAction value:self selection
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   781
            ].
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   782
            fileSelectAction notNil ifTrue:[
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   783
                fileSelectAction value:self selection
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   784
            ]
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   785
        ]
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   786
    ]
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   787
6105
d643337ff3e6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
   788
    "Modified: / 18-04-1996 / 18:44:30 / cg"
d643337ff3e6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
   789
    "Modified (comment): / 13-02-2017 / 20:19:06 / cg"
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   790
!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   791
329
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   792
sizeChanged:how
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   793
    "redraw marks if any"
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   794
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   795
    super sizeChanged:how.
2913
bdf4fb09cfc0 invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2833
diff changeset
   796
    markDirectories ifTrue:[
720
2fb021555f9d use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   797
        self invalidate
330
56fcae58bcb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
   798
    ]
720
2fb021555f9d use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   799
2fb021555f9d use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   800
    "Modified: 29.5.1996 / 16:15:12 / cg"
329
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   801
! !
dc3de413de73 redraw directoryMarks if size changes
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   802
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   803
!FileSelectionList methodsFor:'initialization'!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   804
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   805
initialize
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   806
    directory := Filename currentDirectory.
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   807
    stayInDirectory := ignoreParentDirectory := ignoreDirectories := false.
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   808
    ignoreFiles := quickDirectoryChange := false.
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
   809
    markDirectories := true.
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   810
    super initialize.
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   811
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   812
    pattern := '*'.
2377
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   813
    ignoreCaseInPattern := Filename isCaseSensitive not.
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   814
    self initializeAction.
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   815
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   816
    "nontypical use ..."
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   817
    "
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   818
     FileSelectionList new open
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   819
     (FileSelectionList new directory:'/etc') open
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   820
     (ScrollableView for:FileSelectionList) open
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   821
     (HVScrollableView for:FileSelectionList) open
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   822
    "
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   823
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   824
    "Modified: 18.4.1996 / 18:49:19 / cg"
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   825
    "Modified: 18.9.1997 / 18:52:03 / stefan"
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   826
!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   827
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   828
initializeAction
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   829
    "setup action as: selections in list get forwarded to enterfield if not 
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   830
     a directory; otherwise directory is changed"
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   831
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   832
    actionBlock := [:lineNr | self selectionChanged].
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   833
"/    doubleClickActionBlock := [:lineNr | self selectionChanged].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   834
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   835
    "Modified: 4.3.1996 / 17:39:08 / cg"
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   836
!
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   837
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   838
reinitialize
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   839
    directory := Filename currentDirectory.
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   840
    super reinitialize
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   841
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   842
    "Modified: 18.9.1997 / 18:52:16 / stefan"
21
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
   843
! !
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
   844
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
   845
!FileSelectionList methodsFor:'private'!
c47dbae39a71 Initial revision
claus
parents:
diff changeset
   846
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   847
changeDirectory
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   848
    "change directory to the selected one"
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   849
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   850
    |entry|
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   851
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   852
    entry := self selectionValue.
3238
7b868226a0c0 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 3224
diff changeset
   853
    (entry isEmptyOrNil) ifTrue:[^ self].
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   854
3238
7b868226a0c0 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 3224
diff changeset
   855
    (self changeDirectoryTo:entry) ifFalse:[^ self].
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   856
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   857
    directoryStack := nil.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   858
!
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   859
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   860
changeDirectoryTo:newDirectory
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   861
    "change directory; check if allowed; return true if change was ok"
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   862
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   863
    |entry ok newDir warnMessage oldDir|
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   864
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   865
    entry := newDirectory.
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   866
    (entry endsWith:' ...') ifTrue:[
4561
a7b226d6e51b Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4356
diff changeset
   867
        entry := entry copyButLast:4.
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   868
    ].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   869
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   870
    ok := false.
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   871
    oldDir := directory baseName.
4356
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   872
    entry asFilename isAbsolute ifTrue:[
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   873
        newDir := entry asFilename.
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   874
    ] ifFalse:[
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   875
        newDir := directory construct:entry.
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   876
    ].
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   877
    (directoryChangeCheckBlock isNil
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   878
    or:[directoryChangeCheckBlock value:newDir]) ifTrue:[
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   879
        newDir isReadable ifFalse:[
4356
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   880
            warnMessage := 'No permission to read directory "%1" !!'
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   881
        ] ifTrue:[
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
   882
            newDir isExecutable ifFalse:[
4356
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   883
                warnMessage := 'No permission to enter directory "%1" !!'
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   884
            ] ifTrue:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   885
                ok := true.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   886
            ]
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   887
        ].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   888
    ].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   889
    ok ifFalse:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   890
        warnMessage notNil ifTrue:[
4356
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   891
            self warn:warnMessage with:entry.
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   892
        ].
684
015c23130d7b selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   893
        self setSelection:nil
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   894
    ] ifTrue:[
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   895
        self directory:newDir.
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   896
        entry = '..' ifTrue:[
690
d579f684aa7e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 684
diff changeset
   897
            self setSelectElement:oldDir 
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   898
        ].
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   899
    ].
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   900
    ^ ok
4356
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   901
77d9a477cf89 changed: #changeDirectoryTo:
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
   902
    "Modified: / 23-01-2012 / 18:16:19 / cg"
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   903
!
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   904
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   905
changeToParentDirectory
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   906
    "change to the parent directory"
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   907
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   908
    |current parent|
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   909
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   910
    current := self directory asFilename.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   911
    parent := current directory.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   912
    parent = current ifTrue:[^ false].
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   913
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   914
    (self changeDirectoryTo:'..') ifFalse:[^ false].
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   915
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   916
    directoryStack isNil ifTrue:[
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   917
        directoryStack := OrderedCollection new.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   918
    ].
6183
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   919
    directoryStack addFirst:current pathName.
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   920
    ^ true
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   921
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   922
    "Modified: / 16-07-2017 / 13:48:13 / cg"
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   923
!
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   924
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   925
changeToPreviousDirectory
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   926
    "change to the previous directory"
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   927
6183
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   928
    |previous|
2226
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   929
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   930
    directoryStack size == 0 ifTrue:[^ false].
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   931
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   932
    previous := directoryStack removeFirst.
bf23595862d9 cursorLeft & cursorRight handling like in fileBrowser
Claus Gittinger <cg@exept.de>
parents: 2093
diff changeset
   933
6183
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   934
    ^ (self changeDirectoryTo:(previous asFilename baseName))
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   935
0ba0e432ebaa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 6105
diff changeset
   936
    "Modified: / 16-07-2017 / 13:48:28 / cg"
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   937
!
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   938
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   939
selectionIsDirectory
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   940
    "return true, if the current selection is a directory"
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   941
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   942
    |entry|
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   943
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   944
    entry := self selectionValue.
3238
7b868226a0c0 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 3224
diff changeset
   945
    (entry isEmptyOrNil) ifTrue:[ ^ false].
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   946
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   947
    (entry endsWith:' ...') ifTrue:[
4561
a7b226d6e51b Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4356
diff changeset
   948
        entry := entry copyButLast:4.
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   949
    ].
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   950
    ^ (directory construct:entry) isDirectory
467
ecf956d44135 now needs double click to change directory (configurable)
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
   951
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   952
    "Created: / 4.3.1996 / 17:43:26 / cg"
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   953
    "Modified: / 18.9.1997 / 23:37:05 / stefan"
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   954
    "Modified: / 22.9.1998 / 12:30:21 / cg"
296
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   955
!
e1b9431b3aef more examples in the documentation category
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   956
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   957
updateList
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   958
    "set the lists contents to the filenames in the directory"
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   959
2833
1544bb56f6bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2832
diff changeset
   960
    |newList newTypes obsolete 
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   961
     matching dir ignoreCase|
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   962
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   963
    directory isNil ifTrue:[
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   964
        self list:nil.
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
   965
        ^ self
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   966
    ].
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   967
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   968
    self withCursor:(Cursor read) do:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   969
        "
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   970
         if the directory-id changed, MUST update.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   971
         (can happen after a restart, when a file is no longer
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   972
          there, has moved or is NFS-mounted differently)
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   973
        "
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   974
        obsolete := directoryId ~~ directory id
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   975
                    or:[directoryName ~= directory pathName
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   976
                    or:[timeStamp notNil
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   977
                        and:[directory modificationTime > timeStamp]]].
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   978
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   979
        obsolete ifTrue:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   980
            timeStamp := directory modificationTime.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   981
            directoryId := directory id.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   982
            directoryName := directory pathName.
3824
2e4899919eac updateList - care for vanishing directory
Claus Gittinger <cg@exept.de>
parents: 3238
diff changeset
   983
            [
2e4899919eac updateList - care for vanishing directory
Claus Gittinger <cg@exept.de>
parents: 3238
diff changeset
   984
                directoryContents := (directory fullDirectoryContents ? #()) sort.
2e4899919eac updateList - care for vanishing directory
Claus Gittinger <cg@exept.de>
parents: 3238
diff changeset
   985
            ] on:FileStream openErrorSignal do:[:ex|
2e4899919eac updateList - care for vanishing directory
Claus Gittinger <cg@exept.de>
parents: 3238
diff changeset
   986
                directoryContents := nil
2e4899919eac updateList - care for vanishing directory
Claus Gittinger <cg@exept.de>
parents: 3238
diff changeset
   987
            ].
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
   988
        ].
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   989
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   990
        newList := OrderedCollection new.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   991
        newTypes := OrderedCollection new.
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   992
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   993
        ignoreCase := ignoreCaseInPattern ? (Filename isCaseSensitive not).
2093
ac231f0404d9 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   994
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   995
        dir := directory pathName asFilename.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   996
        directoryContents do:[:name |
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   997
            |type fn fullName isDirectory ignore|
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
   998
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
   999
            fn := dir construct:name.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1000
            fullName := dir constructString:name.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1001
            isDirectory := fn isDirectory.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1002
            ignore := true.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1003
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1004
            (matchBlock isNil or:[matchBlock value:fullName]) ifTrue:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1005
                isDirectory ifTrue:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1006
                    ignoreDirectories ifFalse:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1007
                        name = '..' ifTrue:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1008
                            ignoreParentDirectory ifFalse:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1009
                                ignore := false.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1010
                            ]
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1011
                        ] ifFalse:[
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1012
                            name = '.' ifTrue:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1013
                                "ignore"
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1014
                            ] ifFalse:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1015
                                ignore := false.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1016
                            ]
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1017
                        ]
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1018
                    ]
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1019
                ] ifFalse:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1020
                    ignoreFiles ifFalse:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1021
                        matching := true.
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1022
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1023
                        (pattern size > 0) ifTrue:[ 
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1024
                            pattern ~= '*' ifTrue:[
4711
63f8eaa7e296 class: FileSelectionList
Claus Gittinger <cg@exept.de>
parents: 4561
diff changeset
  1025
                                matching := pattern compoundMatch:name caseSensitive:ignoreCase not
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1026
                            ]
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1027
                        ].
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1028
                                        
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1029
                        matching ifTrue:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1030
                            ignore := false.
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1031
                        ]
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1032
                    ]
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1033
                ].
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1034
            ].
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1035
            ignore ifFalse:[
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1036
                newList add:name.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1037
                newTypes add:isDirectory.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1038
            ].
350
e3512322cb87 allow multiple patterns sep'd by semi
ca
parents: 338
diff changeset
  1039
        ].
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1040
        directoryFileTypes := newTypes.
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1041
        self list:newList.
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
  1042
    ].
547
6c9aaf7a84e7 commentary; examples, added ignoreFiles / fileSelectAction & directorySelectAction
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
  1043
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
  1044
    "Modified: / 18.9.1997 / 23:43:52 / stefan"
2093
ac231f0404d9 care for case-insensitive systems in pattern-match (windows)
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  1045
    "Modified: / 16.12.1999 / 01:23:41 / cg"
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
  1046
!
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
  1047
2377
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1048
updateListWithoutScrolling
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1049
    "set the lists contents to the filenames in the directory"
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1050
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1051
    |sav|
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1052
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1053
    sav := scrollWhenUpdating.
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1054
    scrollWhenUpdating := nil.
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1055
    self updateList.
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1056
    scrollWhenUpdating := sav
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1057
!
977c3d87e61f added optional ignoreCase in matchPattern.
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1058
21
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1059
visibleLineNeedsSpecialCare:visLineNr
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1060
    |l|
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1061
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1062
    l := self visibleLineToListLine:visLineNr.
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1063
    l notNil ifTrue:[
2832
23ad57a4ad76 index bug fixed
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  1064
        (directoryFileTypes at:l) ifTrue:[^ true].
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
  1065
        ^ super visibleLineNeedsSpecialCare:visLineNr
21
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1066
    ].
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1067
    ^ false
1687
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
  1068
bf72059725a1 fixes & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1445
diff changeset
  1069
    "Modified: / 22.9.1998 / 12:32:48 / cg"
21
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1070
!
9ef599238fea *** empty log message ***
claus
parents: 11
diff changeset
  1071
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1072
widthForScrollBetween:firstLine and:lastLine
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1073
    "return the width in pixels for a scroll between firstLine and lastLine
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1074
     - return full width here since there might be directory marks"
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1075
193
6ccc226ce3a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1076
    ^ (width - margin - margin)
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1077
! !
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1078
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1079
!FileSelectionList methodsFor:'realization'!
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1080
1276
75aa3838f308 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1081
realize
1272
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1082
    "check if directory is still valid (using timestamp and inode numbers)
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1083
     - reread if not"
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1084
1276
75aa3838f308 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1085
    super realize.
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1086
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1087
    (timeStamp isNil 
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
  1088
     or:[(directory modificationTime > timeStamp) 
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1089
     or:[(directoryId isNil)
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1090
     or:[directoryId ~~ directory id]]]) ifTrue:[
1272
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1091
        directoryId := nil.
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1092
        self updateList
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1093
    ].
1272
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1094
1276
75aa3838f308 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1272
diff changeset
  1095
    "Created: 24.7.1997 / 18:24:36 / cg"
1330
21a3d397233e Use Filename instead of obsolete FileDirectory.
Stefan Vogel <sv@exept.de>
parents: 1318
diff changeset
  1096
    "Modified: 18.9.1997 / 23:36:10 / stefan"
11
c47dbae39a71 Initial revision
claus
parents:
diff changeset
  1097
! !
77
565b052f5277 *** empty log message ***
claus
parents: 62
diff changeset
  1098
1272
c22a8fbe90ed #realize -> #postRealize
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
  1099
!FileSelectionList class methodsFor:'documentation'!
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
  1100
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
  1101
version
5589
84ac406042c9 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 4711
diff changeset
  1102
    ^ '$Header$'
282
8e0e072c1981 allow suppress of arrow-drawing directories
ca
parents: 193
diff changeset
  1103
! !
4561
a7b226d6e51b Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 4356
diff changeset
  1104