List.setSelection

Selects the items in the range specified by the given zero-relative indices in the receiver. The range of indices is inclusive. The current selection is cleared before the new items are selected. <p> Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.

@param start the start index of the items to select @param end the end index of the items to select

@exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>

@see List#deselectAll() @see List#select(int,int)

  1. void setSelection(int index)
  2. void setSelection(int start, int end)
    class List
    void
    setSelection
    (
    int start
    ,
    int end
    )
  3. void setSelection(int[] indices)
  4. void setSelection(String[] items)

Meta