Changeset 239:43b41c7fe84a
- Timestamp:
- 06/20/08 10:27:36
(3 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
work on allow null strings and arrays
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r220 |
r239 |
|
| 1799 | 1799 | * @param pointArray an array of alternating x and y values which are the vertices of the polygon |
|---|
| 1800 | 1800 | * |
|---|
| 1801 | | * @exception IllegalArgumentException <ul> |
|---|
| 1802 | | * <li>ERROR_NULL_ARGUMENT if pointArray is null</li> |
|---|
| 1803 | | * </ul> |
|---|
| 1804 | 1801 | * @exception DWTException <ul> |
|---|
| 1805 | 1802 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1808 | 1805 | public void drawPolygon( int[] pointArray) { |
|---|
| 1809 | 1806 | if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
|---|
| 1810 | | if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1807 | // DWT extension: allow null array |
|---|
| | 1808 | //if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1811 | 1809 | checkGC(DRAW); |
|---|
| 1812 | 1810 | auto gdipGraphics = data.gdipGraphics; |
|---|
| … | … | |
| 1844 | 1842 | * @param pointArray an array of alternating x and y values which are the corners of the polyline |
|---|
| 1845 | 1843 | * |
|---|
| 1846 | | * @exception IllegalArgumentException <ul> |
|---|
| 1847 | | * <li>ERROR_NULL_ARGUMENT - if the point array is null</li> |
|---|
| 1848 | | * </ul> |
|---|
| 1849 | 1844 | * @exception DWTException <ul> |
|---|
| 1850 | 1845 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1853 | 1848 | public void drawPolyline(int[] pointArray) { |
|---|
| 1854 | 1849 | if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
|---|
| 1855 | | if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1850 | // DWT externsion: allow null array |
|---|
| | 1851 | //if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1856 | 1852 | checkGC(DRAW); |
|---|
| 1857 | 1853 | auto gdipGraphics = data.gdipGraphics; |
|---|
| … | … | |
| 2092 | 2088 | * @param y the y coordinate of the top left corner of the rectangular area where the string is to be drawn |
|---|
| 2093 | 2089 | * |
|---|
| 2094 | | * @exception IllegalArgumentException <ul> |
|---|
| 2095 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 2096 | | * </ul> |
|---|
| 2097 | 2090 | * @exception DWTException <ul> |
|---|
| 2098 | 2091 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2116 | 2109 | * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque |
|---|
| 2117 | 2110 | * |
|---|
| 2118 | | * @exception IllegalArgumentException <ul> |
|---|
| 2119 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 2120 | | * </ul> |
|---|
| 2121 | 2111 | * @exception DWTException <ul> |
|---|
| 2122 | 2112 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2125 | 2115 | public void drawString (String string, int x, int y, bool isTransparent) { |
|---|
| 2126 | 2116 | if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
|---|
| 2127 | | if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 2117 | // DWT extension: allow null string |
|---|
| | 2118 | //if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| 2128 | 2119 | // TCHAR buffer = new TCHAR (getCodePage(), string, false); |
|---|
| 2129 | 2120 | wchar[] wstr = StrToWCHARs( string ); |
|---|
| … | … | |
| 2248 | 2239 | * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn |
|---|
| 2249 | 2240 | * |
|---|
| 2250 | | * @exception IllegalArgumentException <ul> |
|---|
| 2251 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 2252 | | * </ul> |
|---|
| 2253 | 2241 | * @exception DWTException <ul> |
|---|
| 2254 | 2242 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2272 | 2260 | * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque |
|---|
| 2273 | 2261 | * |
|---|
| 2274 | | * @exception IllegalArgumentException <ul> |
|---|
| 2275 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 2276 | | * </ul> |
|---|
| 2277 | 2262 | * @exception DWTException <ul> |
|---|
| 2278 | 2263 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2312 | 2297 | * @param flags the flags specifying how to process the text |
|---|
| 2313 | 2298 | * |
|---|
| 2314 | | * @exception IllegalArgumentException <ul> |
|---|
| 2315 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 2316 | | * </ul> |
|---|
| 2317 | 2299 | * @exception DWTException <ul> |
|---|
| 2318 | 2300 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2321 | 2303 | public void drawText (String string, int x, int y, int flags) { |
|---|
| 2322 | 2304 | if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
|---|
| 2323 | | if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 2305 | // DWT extension: allow null string |
|---|
| | 2306 | //if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| 2324 | 2307 | if (string.length is 0) return; |
|---|
| 2325 | 2308 | auto gdipGraphics = data.gdipGraphics; |
|---|
| … | … | |
| 2772 | 2755 | * @param pointArray an array of alternating x and y values which are the vertices of the polygon |
|---|
| 2773 | 2756 | * |
|---|
| 2774 | | * @exception IllegalArgumentException <ul> |
|---|
| 2775 | | * <li>ERROR_NULL_ARGUMENT if pointArray is null</li> |
|---|
| 2776 | | * </ul> |
|---|
| 2777 | 2757 | * @exception DWTException <ul> |
|---|
| 2778 | 2758 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 2783 | 2763 | public void fillPolygon(int[] pointArray) { |
|---|
| 2784 | 2764 | if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
|---|
| 2785 | | if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 2765 | // DWT externsion: allow null array |
|---|
| | 2766 | //if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
|---|
| 2786 | 2767 | checkGC(FILL); |
|---|
| 2787 | 2768 | if (data.gdipGraphics !is null) { |
|---|
| … | … | |
| 4737 | 4718 | * @return a point containing the extent of the string |
|---|
| 4738 | 4719 | * |
|---|
| 4739 | | * @exception IllegalArgumentException <ul> |
|---|
| 4740 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 4741 | | * </ul> |
|---|
| 4742 | 4720 | * @exception DWTException <ul> |
|---|
| 4743 | 4721 | * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 4746 | 4724 | public Point stringExtent(String string) { |
|---|
| 4747 | 4725 | if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
|---|
| 4748 | | if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 4726 | // DWT externsion: allow null string |
|---|
| | 4727 | //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 4749 | 4728 | checkGC(FONT); |
|---|
| 4750 | 4729 | int length_ = string.length; |
|---|
| r213 |
r239 |
|
| 75 | 75 | * @return the program or <code>null</code> |
|---|
| 76 | 76 | * |
|---|
| 77 | | * @exception IllegalArgumentException <ul> |
|---|
| 78 | | * <li>ERROR_NULL_ARGUMENT when extension is null</li> |
|---|
| 79 | | * </ul> |
|---|
| 80 | 77 | */ |
|---|
| 81 | 78 | public static Program findProgram (String extension) { |
|---|
| 82 | | if (extension is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 79 | // DWT extension: allow null string |
|---|
| | 80 | //if (extension is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 83 | 81 | if (extension.length is 0) return null; |
|---|
| 84 | 82 | if (extension.charAt (0) !is '.') extension = "." ~ extension; //$NON-NLS-1$ |
|---|
| r213 |
r239 |
|
| 1025 | 1025 | /*public*/ void setMessage (String message) { |
|---|
| 1026 | 1026 | checkWidget (); |
|---|
| 1027 | | if (message is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1027 | // DWT externsion: allow null string |
|---|
| | 1028 | //if (message is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1028 | 1029 | this.message = message; |
|---|
| 1029 | 1030 | if (OS.COMCTL32_VERSION >= OS.VERSION (6, 1)) { |
|---|
| … | … | |
| 1110 | 1111 | * @param string the new text |
|---|
| 1111 | 1112 | * |
|---|
| 1112 | | * @exception IllegalArgumentException <ul> |
|---|
| 1113 | | * <li>ERROR_NULL_ARGUMENT - if the text is null</li> |
|---|
| 1114 | | * </ul> |
|---|
| 1115 | 1113 | * @exception DWTException <ul> |
|---|
| 1116 | 1114 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1120 | 1118 | public void setText (String string) { |
|---|
| 1121 | 1119 | checkWidget (); |
|---|
| 1122 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1120 | // DWT externsion: allow null string |
|---|
| | 1121 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1123 | 1122 | if ((style & DWT.ARROW) !is 0) return; |
|---|
| 1124 | 1123 | text = string; |
|---|
| r237 |
r239 |
|
| 175 | 175 | * @param string the new item |
|---|
| 176 | 176 | * |
|---|
| 177 | | * @exception IllegalArgumentException <ul> |
|---|
| 178 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 179 | | * </ul> |
|---|
| 180 | 177 | * @exception DWTException <ul> |
|---|
| 181 | 178 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 187 | 184 | public void add (String string) { |
|---|
| 188 | 185 | checkWidget (); |
|---|
| 189 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 186 | // DWT extension: allow null string |
|---|
| | 187 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 190 | 188 | auto buffer = StrToTCHARs( getCodePage(), string, true ); |
|---|
| 191 | 189 | int result = OS.SendMessage (handle, OS.CB_ADDSTRING, 0, buffer.ptr ); |
|---|
| … | … | |
| 208 | 206 | * |
|---|
| 209 | 207 | * @exception IllegalArgumentException <ul> |
|---|
| 210 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 211 | 208 | * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li> |
|---|
| 212 | 209 | * </ul> |
|---|
| … | … | |
| 220 | 217 | public void add (String string, int index) { |
|---|
| 221 | 218 | checkWidget (); |
|---|
| 222 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 219 | // DWT extension: allow null string |
|---|
| | 220 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 223 | 221 | int count = OS.SendMessage (handle, OS.CB_GETCOUNT, 0, 0); |
|---|
| 224 | 222 | if (!(0 <= index && index <= count)) { |
|---|
| … | … | |
| 980 | 978 | * @return the index of the item |
|---|
| 981 | 979 | * |
|---|
| 982 | | * @exception IllegalArgumentException <ul> |
|---|
| 983 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 984 | | * </ul> |
|---|
| 985 | 980 | * @exception DWTException <ul> |
|---|
| 986 | 981 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1003 | 998 | * @return the index of the item |
|---|
| 1004 | 999 | * |
|---|
| 1005 | | * @exception IllegalArgumentException <ul> |
|---|
| 1006 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 1007 | | * </ul> |
|---|
| 1008 | 1000 | * @exception DWTException <ul> |
|---|
| 1009 | 1001 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1013 | 1005 | public int indexOf (String string, int start) { |
|---|
| 1014 | 1006 | checkWidget (); |
|---|
| 1015 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1007 | // DWT externsion: allow null string |
|---|
| | 1008 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1016 | 1009 | |
|---|
| 1017 | 1010 | /* |
|---|
| … | … | |
| 1024 | 1017 | int count = getItemCount (); |
|---|
| 1025 | 1018 | for (int i=start; i<count; i++) { |
|---|
| 1026 | | if (string==/*eq*/getItem (i)) return i; |
|---|
| | 1019 | if (string.equals (getItem (i))) return i; |
|---|
| 1027 | 1020 | } |
|---|
| 1028 | 1021 | return -1; |
|---|
| … | … | |
| 1226 | 1219 | * |
|---|
| 1227 | 1220 | * @exception IllegalArgumentException <ul> |
|---|
| 1228 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 1229 | 1221 | * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li> |
|---|
| 1230 | 1222 | * </ul> |
|---|
| … | … | |
| 1236 | 1228 | public void remove (String string) { |
|---|
| 1237 | 1229 | checkWidget (); |
|---|
| 1238 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1230 | // DWT extension: allow null string |
|---|
| | 1231 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1239 | 1232 | int index = indexOf (string, 0); |
|---|
| 1240 | 1233 | if (index is -1) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| … | … | |
| 1531 | 1524 | * @exception IllegalArgumentException <ul> |
|---|
| 1532 | 1525 | * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> |
|---|
| 1533 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 1534 | 1526 | * </ul> |
|---|
| 1535 | 1527 | * @exception DWTException <ul> |
|---|
| … | … | |
| 1540 | 1532 | public void setItem (int index, String string) { |
|---|
| 1541 | 1533 | checkWidget (); |
|---|
| 1542 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1534 | // DWT extension: allow null string |
|---|
| | 1535 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1543 | 1536 | int selection = getSelectionIndex (); |
|---|
| 1544 | 1537 | remove (index, false); |
|---|
| … | … | |
| 1554 | 1547 | * |
|---|
| 1555 | 1548 | * @exception IllegalArgumentException <ul> |
|---|
| 1556 | | * <li>ERROR_NULL_ARGUMENT - if the items array is null</li> |
|---|
| 1557 | 1549 | * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li> |
|---|
| 1558 | 1550 | * </ul> |
|---|
| … | … | |
| 1564 | 1556 | public void setItems (String [] items) { |
|---|
| 1565 | 1557 | checkWidget (); |
|---|
| 1566 | | if (items is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1558 | // DWT extension: allow null string |
|---|
| | 1559 | //if (items is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1567 | 1560 | for (int i=0; i<items.length; i++) { |
|---|
| 1568 | 1561 | if (items [i] is null) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| … | … | |
| 1805 | 1798 | * @param string the new text |
|---|
| 1806 | 1799 | * |
|---|
| 1807 | | * @exception IllegalArgumentException <ul> |
|---|
| 1808 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 1809 | | * </ul> |
|---|
| 1810 | 1800 | * @exception DWTException <ul> |
|---|
| 1811 | 1801 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1815 | 1805 | public void setText (String string) { |
|---|
| 1816 | 1806 | checkWidget (); |
|---|
| 1817 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1807 | // DWT externsion: allow null string |
|---|
| | 1808 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1818 | 1809 | if ((style & DWT.READ_ONLY) !is 0) { |
|---|
| 1819 | 1810 | int index = indexOf (string); |
|---|
| r213 |
r239 |
|
| 816 | 816 | * </ul> |
|---|
| 817 | 817 | * @exception IllegalArgumentException <ul> |
|---|
| 818 | | * <li>ERROR_NULL_ARGUMENT - if item order or sizes is null</li> |
|---|
| 819 | 818 | * <li>ERROR_INVALID_ARGUMENT - if item order or sizes is not the same length as the number of items</li> |
|---|
| 820 | 819 | * </ul> |
|---|
| … | … | |
| 842 | 841 | * </ul> |
|---|
| 843 | 842 | * @exception IllegalArgumentException <ul> |
|---|
| 844 | | * <li>ERROR_NULL_ARGUMENT - if the item order is null</li> |
|---|
| 845 | 843 | * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li> |
|---|
| 846 | 844 | * </ul> |
|---|
| 847 | 845 | */ |
|---|
| 848 | 846 | void setItemOrder (int [] itemOrder) { |
|---|
| 849 | | if (itemOrder is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 847 | // DWT extension: allow null array |
|---|
| | 848 | //if (itemOrder is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 850 | 849 | int itemCount = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0); |
|---|
| 851 | 850 | if (itemOrder.length !is itemCount) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| … | … | |
| 906 | 905 | */ |
|---|
| 907 | 906 | void setItemSizes (Point [] sizes) { |
|---|
| 908 | | if (sizes is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 907 | // DWT extension: allow null array |
|---|
| | 908 | //if (sizes is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 909 | 909 | int count = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0); |
|---|
| 910 | 910 | if (sizes.length !is count) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| r213 |
r239 |
|
| 1061 | 1061 | * |
|---|
| 1062 | 1062 | * @exception IllegalArgumentException <ul> |
|---|
| 1063 | | * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li> |
|---|
| 1064 | 1063 | * <li>ERROR_INVALID_ARGUMENT - if one of the images is null or has been disposed</li> |
|---|
| 1065 | 1064 | * </ul> |
|---|
| … | … | |
| 1073 | 1072 | public void setImages (Image [] images) { |
|---|
| 1074 | 1073 | checkWidget (); |
|---|
| 1075 | | if (images is null) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| | 1074 | // DWT extension: allow null array |
|---|
| | 1075 | //if (images is null) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| 1076 | 1076 | for (int i = 0; i < images.length; i++) { |
|---|
| 1077 | 1077 | if (images [i] is null || images [i].isDisposed ()) error (DWT.ERROR_INVALID_ARGUMENT); |
|---|
| … | … | |
| 1329 | 1329 | * @param string the new text |
|---|
| 1330 | 1330 | * |
|---|
| 1331 | | * @exception IllegalArgumentException <ul> |
|---|
| 1332 | | * <li>ERROR_NULL_ARGUMENT - if the text is null</li> |
|---|
| 1333 | | * </ul> |
|---|
| 1334 | 1331 | * @exception DWTException <ul> |
|---|
| 1335 | 1332 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 1339 | 1336 | public void setText (String string) { |
|---|
| 1340 | 1337 | checkWidget (); |
|---|
| 1341 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1338 | // DWT extension: allow null string |
|---|
| | 1339 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1342 | 1340 | /* Use the character encoding for the default locale */ |
|---|
| 1343 | 1341 | TCHAR[] buffer = StrToTCHARs (string, true); |
|---|
| r213 |
r239 |
|
| 256 | 256 | * @param string the new text |
|---|
| 257 | 257 | * |
|---|
| 258 | | * @exception IllegalArgumentException <ul> |
|---|
| 259 | | * <li>ERROR_NULL_ARGUMENT - if the text is null</li> |
|---|
| 260 | | * </ul> |
|---|
| 261 | 258 | * @exception DWTException <ul> |
|---|
| 262 | 259 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 265 | 262 | */ |
|---|
| 266 | 263 | public void setText (String string) { |
|---|
| 267 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 264 | // DWT extension: allow null string |
|---|
| | 265 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 268 | 266 | title = string; |
|---|
| 269 | 267 | } |
|---|
| r213 |
r239 |
|
| 309 | 309 | * @param string the message |
|---|
| 310 | 310 | * |
|---|
| 311 | | * @exception IllegalArgumentException <ul> |
|---|
| 312 | | * <li>ERROR_NULL_ARGUMENT - if the string is null</li> |
|---|
| 313 | | * </ul> |
|---|
| 314 | 311 | */ |
|---|
| 315 | 312 | public void setMessage (String string) { |
|---|
| 316 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 313 | // DWT extension: allow null string |
|---|
| | 314 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 317 | 315 | message = string; |
|---|
| 318 | 316 | } |
|---|
| r237 |
r239 |
|
| 1627 | 1627 | * @return the value of the property or null if it has not been set |
|---|
| 1628 | 1628 | * |
|---|
| 1629 | | * @exception IllegalArgumentException <ul> |
|---|
| 1630 | | * <li>ERROR_NULL_ARGUMENT - if the key is null</li> |
|---|
| 1631 | | * </ul> |
|---|
| 1632 | 1629 | * @exception DWTException <ul> |
|---|
| 1633 | 1630 | * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
|---|
| … | … | |
| 1640 | 1637 | public Object getData (String key) { |
|---|
| 1641 | 1638 | checkDevice (); |
|---|
| 1642 | | if (key is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 1639 | // DWT extension: allow null string |
|---|
| | 1640 | //if (key is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 1643 | 1641 | if (key ==/*eq*/RUN_MESSAGES_IN_IDLE_KEY) { |
|---|
| 1644 | 1642 | return new ValueWrapperBool(runMessagesInIdle); |
|---|
| … | … | |
| 4082 | 4080 | * @param value the new value for the property |
|---|
| 4083 | 4081 | * |
|---|
| 4084 | | * @exception IllegalArgumentException <ul> |
|---|
| 4085 | | * <li>ERROR_NULL_ARGUMENT - if the key is null</li> |
|---|
| 4086 | | * </ul> |
|---|
| 4087 | 4082 | * @exception DWTException <ul> |
|---|
| 4088 | 4083 | * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
|---|
| … | … | |
| 4095 | 4090 | public void setData (String key, Object value) { |
|---|
| 4096 | 4091 | checkDevice (); |
|---|
| 4097 | | if (key is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 4092 | // DWT extension: allow null string |
|---|
| | 4093 | //if (key is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 4098 | 4094 | |
|---|
| 4099 | 4095 | if (key ==/*eq*/RUN_MESSAGES_IN_IDLE_KEY) { |
|---|