comparison dwt/widgets/TableItem.d @ 299:4faf63f6948f

Allow null args
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 20:57:52 +0200
parents fd9c62a2998e
children
comparison
equal deleted inserted replaced
298:8fa53b71485d 299:4faf63f6948f
1048 * Sets the image for multiple columns in the table. 1048 * Sets the image for multiple columns in the table.
1049 * 1049 *
1050 * @param images the array of new images 1050 * @param images the array of new images
1051 * 1051 *
1052 * @exception IllegalArgumentException <ul> 1052 * @exception IllegalArgumentException <ul>
1053 * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li>
1054 * <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li> 1053 * <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li>
1055 * </ul> 1054 * </ul>
1056 * @exception DWTException <ul> 1055 * @exception DWTException <ul>
1057 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1056 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1058 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1057 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1059 * </ul> 1058 * </ul>
1060 */ 1059 */
1061 public void setImage (Image [] images) { 1060 public void setImage (Image [] images) {
1062 checkWidget(); 1061 checkWidget();
1063 if (images is null) error (DWT.ERROR_NULL_ARGUMENT);
1064 for (int i=0; i<images.length; i++) { 1062 for (int i=0; i<images.length; i++) {
1065 setImage (i, images [i]); 1063 setImage (i, images [i]);
1066 } 1064 }
1067 } 1065 }
1068 1066
1159 /** 1157 /**
1160 * Sets the text for multiple columns in the table. 1158 * Sets the text for multiple columns in the table.
1161 * 1159 *
1162 * @param strings the array of new strings 1160 * @param strings the array of new strings
1163 * 1161 *
1164 * @exception IllegalArgumentException <ul>
1165 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
1166 * </ul>
1167 * @exception DWTException <ul> 1162 * @exception DWTException <ul>
1168 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1163 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1169 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1164 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1170 * </ul> 1165 * </ul>
1171 */ 1166 */
1172 public void setText (String [] strings) { 1167 public void setText (String [] strings) {
1173 checkWidget(); 1168 checkWidget();
1174 if (strings is null) error (DWT.ERROR_NULL_ARGUMENT);
1175 for (int i=0; i<strings.length; i++) { 1169 for (int i=0; i<strings.length; i++) {
1176 String string = strings [i]; 1170 String string = strings [i];
1177 if (string !is null) setText (i, string); 1171 if (string !is null) setText (i, string);
1178 } 1172 }
1179 } 1173 }
1182 * Sets the receiver's text at a column 1176 * Sets the receiver's text at a column
1183 * 1177 *
1184 * @param index the column index 1178 * @param index the column index
1185 * @param string the new text 1179 * @param string the new text
1186 * 1180 *
1187 * @exception IllegalArgumentException <ul>
1188 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
1189 * </ul>
1190 * @exception DWTException <ul> 1181 * @exception DWTException <ul>
1191 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1182 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1192 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1183 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1193 * </ul> 1184 * </ul>
1194 */ 1185 */
1195 public void setText (int index, String string) { 1186 public void setText (int index, String string) {
1196 checkWidget(); 1187 checkWidget();
1197 if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
1198 if (index is 0) { 1188 if (index is 0) {
1199 if (string ==/*eq*/text) return; 1189 if (string.equals(text)) return;
1200 super.setText (string.dup); 1190 super.setText (string.dup);
1201 } 1191 }
1202 int count = Math.max (1, parent.getColumnCount ()); 1192 int count = Math.max (1, parent.getColumnCount ());
1203 if (0 > index || index > count - 1) return; 1193 if (0 > index || index > count - 1) return;
1204 if (strings is null && index !is 0) { 1194 if (strings is null && index !is 0) {