Mercurial > projects > dwt-win
diff dwt/custom/CCombo.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 | 36f5cb12e1a2 |
children | fd9c62a2998e |
line wrap: on
line diff
--- a/dwt/custom/CCombo.d Sat Jun 28 20:18:36 2008 +0200 +++ b/dwt/custom/CCombo.d Sat Jun 28 20:27:21 2008 +0200 @@ -192,9 +192,6 @@ * * @param string the new item * - * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> * @exception DWTException <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> @@ -204,7 +201,8 @@ */ public void add (String string) { checkWidget(); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); list.add (string); } /** @@ -220,7 +218,6 @@ * @param index the index for the item * * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li> * </ul> * @exception DWTException <ul> @@ -232,7 +229,8 @@ */ public void add (String string, int index) { checkWidget(); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); list.add (string, index); } /** @@ -869,9 +867,6 @@ * @param string the search item * @return the index of the item * - * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> * @exception DWTException <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> @@ -879,7 +874,8 @@ */ public int indexOf (String string) { checkWidget (); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); return list.indexOf (string); } /** @@ -893,9 +889,6 @@ * @param start the zero-relative index at which to begin the search * @return the index of the item * - * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> * @exception DWTException <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> @@ -903,7 +896,8 @@ */ public int indexOf (String string, int start) { checkWidget (); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); return list.indexOf (string, start); } @@ -1237,7 +1231,6 @@ * @param string the item to remove * * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li> * </ul> * @exception DWTException <ul> @@ -1247,7 +1240,8 @@ */ public void remove (String string) { checkWidget(); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); list.remove (string); } /** @@ -1421,7 +1415,6 @@ * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception DWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> @@ -1530,9 +1523,6 @@ * * @param string the new text * - * @exception IllegalArgumentException <ul> - * <li>ERROR_NULL_ARGUMENT - if the string is null</li> - * </ul> * @exception DWTException <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> @@ -1540,7 +1530,8 @@ */ public void setText (String string) { checkWidget(); - if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); + // DWT extension: allow null string + //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); int index = list.indexOf (string); if (index is -1) { list.deselectAll ();