MultipleSelectionListView>>selecion:ifAbsent: confuses me a bit - Smalltalk

This is a discussion on MultipleSelectionListView>>selecion:ifAbsent: confuses me a bit - Smalltalk ; Hi... just stumbled over this Method in MultipleSelectionListView: selection: newSelection ifAbsent: exceptionHandler "Legacy behaviour." ^self selections: newSelection ifAbsent: exceptionHandler Shouldn't this rather use selection: newSelection ifAbsent: exceptionHandler "Legacy behaviour." ^self selections: (Array with: newSelection) ifAbsent: exceptionHandler or something? Or must ...

+ Reply to Thread
Results 1 to 3 of 3

MultipleSelectionListView>>selecion:ifAbsent: confuses me a bit

  1. Default MultipleSelectionListView>>selecion:ifAbsent: confuses me a bit

    Hi...

    just stumbled over this Method in MultipleSelectionListView:
    selection: newSelection ifAbsent: exceptionHandler
    "Legacy behaviour."
    ^self selections: newSelection ifAbsent: exceptionHandler

    Shouldn't this rather use
    selection: newSelection ifAbsent: exceptionHandler
    "Legacy behaviour."
    ^self selections: (Array with: newSelection) ifAbsent: exceptionHandler

    or something? Or must I always pass a collection? I stumbled over it on
    my calls to selectionOrNil: - do I have to send #(nil) or rather nil
    directly fo rMultiSelectListViews?

    Ciao

    ....Jochen



  2. Default Re: MultipleSelectionListView>>selecion:ifAbsent: confuses me a bit

    "Jochen Riekhof" <jochen@rieknospamhof.de> wrote in message
    news:9OOdnQscpcQX_qzZnZ2dnUVZ_s6dnZ2d@totallyobjects.com...
    > Hi...
    >
    > just stumbled over this Method in MultipleSelectionListView:
    > selection: newSelection ifAbsent: exceptionHandler
    > "Legacy behaviour."
    > ^self selections: newSelection ifAbsent: exceptionHandler
    >
    > Shouldn't this rather use
    > selection: newSelection ifAbsent: exceptionHandler
    > "Legacy behaviour."
    > ^self selections: (Array with: newSelection) ifAbsent: exceptionHandler


    No, hence the "Legacy behaviour" comment. Legacy in this case is referring
    to the fact that there was a design error in the implementation of multiple
    selection lists made in the original MVP implementation.

    >
    > or something? Or must I always pass a collection? I stumbled over it on my
    > calls to selectionOrNil: - do I have to send #(nil) or rather nil directly
    > fo rMultiSelectListViews?
    >


    In D6 you should not use MultipleSelectionListView or
    MultipleSelectionListBox. These are only present to support legacy code, and
    you should migrate over to ListView and ListBox as soon as you can. In D6 a
    single class supports both single and multi-select cases controlled by the
    #isMultiSelect: aspect. You will then get sensible and consistent
    implementations of single and multi-select list lists, which you will not
    get using the old (now deprecated) classes.

    Regards

    Blair



  3. Default Re: MultipleSelectionListView>>selecion:ifAbsent: confuses me a bit

    Thank you Blair!

    Ciao

    ....Jochen

    "Blair McGlashan" <blairmcg@object-arts.com> wrote in message
    news:49d80sFo8ve6U1@individual.net...
    > "Jochen Riekhof" <jochen@rieknospamhof.de> wrote in message
    > news:9OOdnQscpcQX_qzZnZ2dnUVZ_s6dnZ2d@totallyobjects.com...
    >> Hi...
    >>
    >> just stumbled over this Method in MultipleSelectionListView:
    >> selection: newSelection ifAbsent: exceptionHandler
    >> "Legacy behaviour."
    >> ^self selections: newSelection ifAbsent: exceptionHandler
    >>
    >> Shouldn't this rather use
    >> selection: newSelection ifAbsent: exceptionHandler
    >> "Legacy behaviour."
    >> ^self selections: (Array with: newSelection) ifAbsent: exceptionHandler

    >
    > No, hence the "Legacy behaviour" comment. Legacy in this case is referring
    > to the fact that there was a design error in the implementation of
    > multiple selection lists made in the original MVP implementation.
    >
    >>
    >> or something? Or must I always pass a collection? I stumbled over it on
    >> my calls to selectionOrNil: - do I have to send #(nil) or rather nil
    >> directly fo rMultiSelectListViews?
    >>

    >
    > In D6 you should not use MultipleSelectionListView or
    > MultipleSelectionListBox. These are only present to support legacy code,
    > and you should migrate over to ListView and ListBox as soon as you can. In
    > D6 a single class supports both single and multi-select cases controlled
    > by the #isMultiSelect: aspect. You will then get sensible and consistent
    > implementations of single and multi-select list lists, which you will not
    > get using the old (now deprecated) classes.
    >
    > Regards
    >
    > Blair
    >




+ Reply to Thread

Similar Threads

  1. Replies: 1
    Last Post: 08-24-2007, 11:26 AM
  2. Replies: 0
    Last Post: 08-16-2007, 01:05 AM