MultiSelectionInList.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Nov 2017 20:09:30 +0100
changeset 6225 0122e4e6c587
parent 5888 86e2b8b7db7c
child 6509 110f6a02e2d5
permissions -rw-r--r--
#FEATURE by cg class: GenericToolbarIconLibrary class added: #hideFilter16x16Icon
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5888
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
     1
"{ Encoding: utf8 }"
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
     2
174
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     3
"
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     5
	      All Rights Reserved
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     6
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     7
 This software is furnished under a license and may be used
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     8
 only in accordance with the terms of that license and with the
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    10
 be provided or otherwise made available to, or used by, any
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    11
 other person.  No title to or ownership of the software is
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    12
 hereby transferred.
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    13
"
2724
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    14
"{ Package: 'stx:libwidg' }"
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
    15
5888
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
    16
"{ NameSpace: Smalltalk }"
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
    17
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
    18
SelectionInList subclass:#MultiSelectionInList
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    19
	instanceVariableNames:''
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    20
	classVariableNames:''
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    21
	poolDictionaries:''
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    22
	category:'Interface-Support-Models'
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
    23
!
5d736ee65276 Initial revision
claus
parents:
diff changeset
    24
174
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    25
!MultiSelectionInList class methodsFor:'documentation'!
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    26
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    27
copyright
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    28
"
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    29
 COPYRIGHT (c) 1995 by Claus Gittinger
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    30
	      All Rights Reserved
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    31
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    32
 This software is furnished under a license and may be used
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    33
 only in accordance with the terms of that license and with the
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    35
 be provided or otherwise made available to, or used by, any
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    36
 other person.  No title to or ownership of the software is
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    37
 hereby transferred.
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    38
"
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    39
!
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    40
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    41
documentation
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    42
"
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    43
    Like a selectionInList, but allows for multiple selected items.
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    44
    For use as a model for SelectionInListViews, with multipleSelectOk set to true.
583
2ec13b7ceba5 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    45
2ec13b7ceba5 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    46
    [author:]
2ec13b7ceba5 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    47
        Claus Gittinger
174
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    48
"
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    49
! !
d80a6cc3f9b2 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 166
diff changeset
    50
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    51
!MultiSelectionInList methodsFor:'accessing-values'!
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    52
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    53
selection
537
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    54
    "return the selections value (i.e. the entry numbers in the list)"
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    55
1413
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    56
    |l s|
537
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    57
1413
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    58
    (     (l := self list) isNil                                "/ mhmh - no list; what should we do here ?
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    59
      or:[(s := selectionIndexHolder value) size == 0]          "/ mhmh - can be nil ?
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    60
    ) ifTrue:[
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    61
        ^ self zeroIndex
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    62
    ].
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    63
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
    64
    ^ s collect:[:index | l at:index ]
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    65
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    66
    "Created: 26.10.1995 / 16:52:27 / cg"
563
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
    67
    "Modified: 20.4.1996 / 13:14:29 / cg"
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
    68
!
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    69
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    70
selection:anObjectList 
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    71
    "set the selection to be anObjectList."
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    72
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    73
    |l indizes objList|
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    74
579
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
    75
    "/
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
    76
    "/ for your convenience: allow 0 and nil as empty
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
    77
    "/ selections
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
    78
    "/
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    79
    anObjectList size == 0 ifTrue:[
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    80
        (anObjectList isCollection or:[anObjectList isNil]) ifTrue:[
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    81
            ^ self selectionIndex:#()
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    82
        ].
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    83
        objList := Array with:anObjectList
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    84
    ] ifFalse:[
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    85
        objList := anObjectList
579
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
    86
    ].
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
    87
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    88
    l := self list.
537
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    89
    l isNil ifTrue:[^ self].   "/ mhmh - no list; what should we do here ?
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    90
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    91
    indizes := OrderedCollection new.
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
    92
    objList do:[:o |
537
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    93
        |idx|
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    94
537
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    95
        idx := l indexOf:o ifAbsent:0.
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    96
        idx ~~ 0 ifTrue:[
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    97
            indizes add:idx
21fc632b22fe dont err when selection is set, but there is no list
Claus Gittinger <cg@exept.de>
parents: 536
diff changeset
    98
        ].
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    99
    ].
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   100
    ^ self selectionIndex:indizes
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   101
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   102
    "Created: 26.10.1995 / 16:40:24 / cg"
579
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   103
    "Modified: 25.4.1996 / 09:07:44 / cg"
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   104
!
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   105
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   106
selectionIndex:indexes
2724
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   107
    "set the list of indexes"
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   108
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   109
    |newIndices|
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   110
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   111
    indexes size ~~ 0 ifTrue:[
2724
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   112
        newIndices := indexes.
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   113
    ] ifFalse:[
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   114
        indexes isNumber ifTrue:[
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   115
            newIndices := OrderedCollection with:indexes    
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   116
        ] ifFalse:[
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   117
            newIndices := #()
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   118
        ].
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   119
    ].
2724
23f4e16dc4f4 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1413
diff changeset
   120
    ^ super selectionIndex:newIndices
1228
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   121
!
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   122
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   123
selectionIndexes
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   124
    "added for ST-80 compatibility
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   125
    "
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   126
    ^ self selectionIndex value
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   127
!
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   128
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   129
selectionIndexes:indizes
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   130
    "added for ST-80 compatibility
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   131
    "
e30336972355 bugFixes & ST-80 compatibility
ca
parents: 583
diff changeset
   132
    ^ self selectionIndex:indizes
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   133
! !
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   134
563
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   135
!MultiSelectionInList methodsFor:'queries'!
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   136
1413
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   137
numberOfSelections
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   138
    "return the number of selected entries
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   139
    "
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   140
    ^ selectionIndexHolder value size
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   141
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   142
!
e00159f1414d add selection queries:
ca
parents: 1410
diff changeset
   143
563
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   144
zeroIndex
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   145
    "return the selectionIndex returned when nothing is selected.
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   146
     Here, an empty collection is returned."
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   147
5888
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
   148
    ^ #()
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   149
563
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   150
    "Modified: 20.4.1996 / 13:12:58 / cg"
166
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   151
! !
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   152
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
   153
!MultiSelectionInList methodsFor:'selections'!
5d736ee65276 Initial revision
claus
parents:
diff changeset
   154
1410
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   155
clearAll
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   156
    "ST80 compatibility"
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   157
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   158
    self selection:nil.
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   159
!
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   160
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   161
selectAll
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   162
    "ST80 compatibility"
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   163
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   164
    |indizes size|
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   165
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   166
    (size := listHolder value size) == 0 ifTrue:[
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   167
        ^ self clearAll
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   168
    ].
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   169
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   170
    indizes := Array new:size.
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   171
    1 to:size do:[:i| indizes at:i put:i].
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   172
    self selectionIndex:indizes.
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   173
!
80332bbccffc ST80 compatibility
ca
parents: 1397
diff changeset
   174
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
   175
selections
3847
bb36b6a3fc7c Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 2724
diff changeset
   176
    <resource: #obsolete>
579
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   177
    "obsolete - almost the same as selection"
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   178
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
   179
    |selectionIndices|
5d736ee65276 Initial revision
claus
parents:
diff changeset
   180
579
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   181
    self obsoleteMethodWarning.
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   182
293
ab897211c99c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   183
    selectionIndices := selectionIndexHolder value.
536
fd1b723e69b6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   184
    (selectionIndices isNil
563
fa563ad7630c zeroIndex stuff
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   185
     or:[selectionIndices == 0     
536
fd1b723e69b6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   186
     or:[selectionIndices isEmpty]]) ifFalse:[
fd1b723e69b6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   187
        ^ selectionIndices collect:[:index | listHolder value at:index]
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
   188
    ].
5888
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
   189
    ^ #()
536
fd1b723e69b6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   190
579
a9188bedbfb9 commentary & backward compatibility fix
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   191
    "Modified: 25.4.1996 / 09:09:45 / cg"
1397
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   192
!
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   193
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   194
selections:aCollection
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   195
    "ST80 compatibility"
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   196
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   197
    ^ self selection:aCollection
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   198
d52f3f02882d added #selections: (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 1228
diff changeset
   199
    "Created: / 8.11.1997 / 12:55:23 / cg"
114
5d736ee65276 Initial revision
claus
parents:
diff changeset
   200
! !
5d736ee65276 Initial revision
claus
parents:
diff changeset
   201
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   202
!MultiSelectionInList class methodsFor:'documentation'!
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   203
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   204
version
5888
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
   205
    ^ '$Header$'
526
8203430fbadd oops - clearing selection was wrong in MultiSelectionInList
ca
parents: 360
diff changeset
   206
! !
5888
86e2b8b7db7c #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 3847
diff changeset
   207