comparison dwt/custom/TableTree.d @ 244:a59d51c12b42

work on allow null strings and arrays
author Frank Benoit <benoit@tionex.de>
date Sat, 28 Jun 2008 20:27:21 +0200
parents ab60f3309436
children 349b8c12e243
comparison
equal deleted inserted replaced
243:ecb80b2a89e1 244:a59d51c12b42
763 * then all items are ignored. 763 * then all items are ignored.
764 * 764 *
765 * @param items the array of items 765 * @param items the array of items
766 * 766 *
767 * @exception IllegalArgumentException <ul> 767 * @exception IllegalArgumentException <ul>
768 * <li>ERROR_NULL_ARGUMENT - if the array of items is null</li>
769 * <li>ERROR_INVALID_ARGUMENT - if one of the item has been disposed</li> 768 * <li>ERROR_INVALID_ARGUMENT - if one of the item has been disposed</li>
770 * </ul> 769 * </ul>
771 * @exception DWTException <ul> 770 * @exception DWTException <ul>
772 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 771 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
773 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 772 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
775 * 774 *
776 * @see TableTree#deselectAll() 775 * @see TableTree#deselectAll()
777 */ 776 */
778 public void setSelection (TableTreeItem[] items) { 777 public void setSelection (TableTreeItem[] items) {
779 checkWidget (); 778 checkWidget ();
780 if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 779 // DWT extension: allow null array
780 //if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
781 int length = items.length; 781 int length = items.length;
782 if (length is 0 || ((table.getStyle() & DWT.SINGLE) !is 0 && length > 1)) { 782 if (length is 0 || ((table.getStyle() & DWT.SINGLE) !is 0 && length > 1)) {
783 deselectAll(); 783 deselectAll();
784 return; 784 return;
785 } 785 }