comparison dwt/widgets/TableItem.d @ 309:e0d7f76515af

Allow null args
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 20:57:41 +0200
parents c0d810de7093
children
comparison
equal deleted inserted replaced
308:dc2ae028d2d8 309:e0d7f76515af
1232 * Sets the image for multiple columns in the table. 1232 * Sets the image for multiple columns in the table.
1233 * 1233 *
1234 * @param images the array of new images 1234 * @param images the array of new images
1235 * 1235 *
1236 * @exception IllegalArgumentException <ul> 1236 * @exception IllegalArgumentException <ul>
1237 * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li>
1238 * <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li> 1237 * <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li>
1239 * </ul> 1238 * </ul>
1240 * @exception DWTException <ul> 1239 * @exception DWTException <ul>
1241 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1240 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1242 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1241 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1243 * </ul> 1242 * </ul>
1244 */ 1243 */
1245 public void setImage (Image [] images) { 1244 public void setImage (Image [] images) {
1246 checkWidget (); 1245 checkWidget ();
1247 if (images is null) error (DWT.ERROR_NULL_ARGUMENT);
1248 for (int i=0; i<images.length; i++) { 1246 for (int i=0; i<images.length; i++) {
1249 setImage (i, images [i]); 1247 setImage (i, images [i]);
1250 } 1248 }
1251 } 1249 }
1252 1250
1274 * Sets the receiver's text at a column 1272 * Sets the receiver's text at a column
1275 * 1273 *
1276 * @param index the column index 1274 * @param index the column index
1277 * @param string the new text 1275 * @param string the new text
1278 * 1276 *
1279 * @exception IllegalArgumentException <ul>
1280 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
1281 * </ul>
1282 * @exception DWTException <ul> 1277 * @exception DWTException <ul>
1283 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1278 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1284 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1279 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1285 * </ul> 1280 * </ul>
1286 */ 1281 */
1287 public void setText (int index, String string) { 1282 public void setText (int index, String string) {
1288 checkWidget (); 1283 checkWidget ();
1289 if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
1290 if (_getText (index).equals (string)) return; 1284 if (_getText (index).equals (string)) return;
1291 int count = Math.max (1, parent.getColumnCount ()); 1285 int count = Math.max (1, parent.getColumnCount ());
1292 if (0 > index || index > count - 1) return; 1286 if (0 > index || index > count - 1) return;
1293 char* buffer = toStringz( string ); 1287 char* buffer = toStringz( string );
1294 int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; 1288 int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
1314 /** 1308 /**
1315 * Sets the text for multiple columns in the table. 1309 * Sets the text for multiple columns in the table.
1316 * 1310 *
1317 * @param strings the array of new strings 1311 * @param strings the array of new strings
1318 * 1312 *
1319 * @exception IllegalArgumentException <ul>
1320 * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
1321 * </ul>
1322 * @exception DWTException <ul> 1313 * @exception DWTException <ul>
1323 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 1314 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1324 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1315 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1325 * </ul> 1316 * </ul>
1326 */ 1317 */
1327 public void setText (String [] strings) { 1318 public void setText (String [] strings) {
1328 checkWidget (); 1319 checkWidget ();
1329 if (strings is null) error (DWT.ERROR_NULL_ARGUMENT);
1330 for (int i=0; i<strings.length; i++) { 1320 for (int i=0; i<strings.length; i++) {
1331 String string = strings [i]; 1321 String string = strings [i];
1332 if (string !is null) setText (i, string); 1322 if (string !is null) setText (i, string);
1333 } 1323 }
1334 } 1324 }