Mercurial > projects > dwt-win
comparison dwt/custom/TableTreeItem.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 |
comparison
equal
deleted
inserted
replaced
243:ecb80b2a89e1 | 244:a59d51c12b42 |
---|---|
817 * number. | 817 * number. |
818 * | 818 * |
819 * @param index the column number | 819 * @param index the column number |
820 * @param text the new text | 820 * @param text the new text |
821 * | 821 * |
822 * @exception IllegalArgumentException <ul> | |
823 * <li>ERROR_NULL_ARGUMENT - if the text is null</li> | |
824 * </ul> | |
825 * @exception DWTException <ul> | 822 * @exception DWTException <ul> |
826 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> | 823 * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> |
827 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> | 824 * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> |
828 * </ul> | 825 * </ul> |
829 */ | 826 */ |
830 public void setText(int index, String text) { | 827 public void setText(int index, String text) { |
831 checkWidget(); | 828 checkWidget(); |
832 if (text is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); | 829 // DWT extension: allow null string |
830 //if (text is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); | |
833 int columnCount = Math.max(parent.getTable().getColumnCount(), 1); | 831 int columnCount = Math.max(parent.getTable().getColumnCount(), 1); |
834 if (index < 0 || index >= columnCount) return; | 832 if (index < 0 || index >= columnCount) return; |
835 if (texts.length < columnCount) { | 833 if (texts.length < columnCount) { |
836 String[] newTexts = new String[columnCount]; | 834 String[] newTexts = new String[columnCount]; |
837 System.arraycopy(texts, 0, newTexts, 0, texts.length); | 835 System.arraycopy(texts, 0, newTexts, 0, texts.length); |