/** * Deselects the items at the given zero-relative indices in the receiver. If the item at the * given zero-relative index in the receiver is selected, it is deselected. If the item at the * index was not selected, it remains deselected. Indices that are out of range and duplicate * indices are ignored. * * @param indices the array of indices for the items to deselect * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the set of indices is null * </ul> * * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * </ul> * * @since 1.3 */ public void deselect(int[] indices) { checkWidget(); if (indices == null) { error(SWT.ERROR_NULL_ARGUMENT); } for (int i = 0; i < indices.length; i++) { removeFromSelection(indices[i]); } }
/** * Deselects the items at the given zero-relative indices in the receiver. If the item at the * given zero-relative index in the receiver is selected, it is deselected. If the item at the * index was not selected, it remains deselected. The range of the indices is inclusive. Indices * that are out of range are ignored. * * @param start the start index of the items to deselect * @param end the end index of the items to deselect * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * </ul> * * @since 1.3 */ public void deselect(int start, int end) { checkWidget(); if (start == 0 && end == model.getItemCount() - 1) { deselectAll(); } else { int actualStart = Math.max(0, start); for (int i = actualStart; i <= end; i++) { removeFromSelection(i); } } }
/** * Deselects the item at the given zero-relative index in the receiver. If the item at the index * was already deselected, it remains deselected. Indices that are out of range are ignored. * * @param index the index of the item to deselect * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * </ul> * * @since 1.3 */ public void deselect(int index) { checkWidget(); removeFromSelection(index); }