Changeset 244:a59d51c12b42

Show
Ignore:
Timestamp:
06/28/08 14:27:21 (4 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
  • dwt/custom/CCombo.d

    r213 r244  
    193193 * @param string the new item 
    194194 * 
    195  * @exception IllegalArgumentException <ul> 
    196  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    197  * </ul> 
    198195 * @exception DWTException <ul> 
    199196 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    205202public void add (String string) { 
    206203    checkWidget(); 
    207     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     204    // DWT extension: allow null string 
     205    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    208206    list.add (string); 
    209207} 
     
    221219 * 
    222220 * @exception IllegalArgumentException <ul> 
    223  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    224221 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li> 
    225222 * </ul> 
     
    233230public void add (String string, int index) { 
    234231    checkWidget(); 
    235     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     232    // DWT extension: allow null string 
     233    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    236234    list.add (string, index); 
    237235} 
     
    870868 * @return the index of the item 
    871869 * 
    872  * @exception IllegalArgumentException <ul> 
    873  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    874  * </ul> 
    875870 * @exception DWTException <ul> 
    876871 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    880875public int indexOf (String string) { 
    881876    checkWidget (); 
    882     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     877    // DWT extension: allow null string 
     878    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    883879    return list.indexOf (string); 
    884880} 
     
    894890 * @return the index of the item 
    895891 * 
    896  * @exception IllegalArgumentException <ul> 
    897  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    898  * </ul> 
    899892 * @exception DWTException <ul> 
    900893 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    904897public int indexOf (String string, int start) { 
    905898    checkWidget (); 
    906     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     899    // DWT extension: allow null string 
     900    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    907901    return list.indexOf (string, start); 
    908902} 
     
    12381232 * 
    12391233 * @exception IllegalArgumentException <ul> 
    1240  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    12411234 *    <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li> 
    12421235 * </ul> 
     
    12481241public void remove (String string) { 
    12491242    checkWidget(); 
    1250     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     1243    // DWT extension: allow null string 
     1244    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    12511245    list.remove (string); 
    12521246} 
     
    14221416 * @exception IllegalArgumentException <ul> 
    14231417 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> 
    1424  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    14251418 * </ul> 
    14261419 * @exception DWTException <ul> 
     
    15311524 * @param string the new text 
    15321525 * 
    1533  * @exception IllegalArgumentException <ul> 
    1534  *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> 
    1535  * </ul> 
    15361526 * @exception DWTException <ul> 
    15371527 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 
     
    15411531public void setText (String string) { 
    15421532    checkWidget(); 
    1543     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     1533    // DWT extension: allow null string 
     1534    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    15441535    int index = list.indexOf (string); 
    15451536    if (index is -1) { 
  • dwt/custom/CTabItem.d

    r213 r244  
    10401040public override void setText (String string) { 
    10411041    checkWidget(); 
    1042     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     1042    // DWT extension: allow null string 
     1043    //if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    10431044    if (string==getText()) return; 
    10441045    super.setText(string); 
  • dwt/custom/PopupList.d

    r212 r244  
    264264* 
    265265* @exception IllegalArgumentException <ul> 
    266 *    <li>ERROR_NULL_ARGUMENT - if the items array is null</li> 
    267266*    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li> 
    268267* </ul> 
  • dwt/custom/StyledText.d

    r214 r244  
    16061606public void append(String string) { 
    16071607    checkWidget(); 
    1608     if (string is null) { 
    1609         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    1610     } 
     1608    // DWT extension: allow null string 
     1609    //if (string is null) { 
     1610    //    DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     1611    //} 
    16111612    int lastChar = Math.max(getCharCount(), 0); 
    16121613    replaceTextRange(lastChar, 0, string); 
     
    49374938 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    49384939 * </ul> 
    4939  * @exception IllegalArgumentException <ul> 
    4940  *    <li>ERROR_NULL_ARGUMENT when string is null</li> 
    4941  * </ul> 
    49424940 */ 
    49434941public void insert(String string) { 
    49444942    checkWidget(); 
    4945     if (string is null) { 
    4946         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    4947     } 
     4943    // DWT extension: allow null string 
     4944    //if (string is null) { 
     4945    //    DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     4946    //} 
    49484947    Point sel = getSelectionRange(); 
    49494948    replaceTextRange(sel.x, sel.y, string); 
     
    64616460 * @exception IllegalArgumentException <ul> 
    64626461 *   <li>ERROR_INVALID_RANGE when either start or end is outside the valid range (0 <= offset <= getCharCount())</li> 
    6463  *   <li>ERROR_NULL_ARGUMENT when ranges is null</li> 
    64646462 * </ul> 
    64656463 * 
     
    64716469    checkWidget(); 
    64726470    if (isListening(LineGetStyle)) return; 
    6473     if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     6471    // DWT extension: allow null array 
     6472    //if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    64746473    setStyleRanges(start, length, null, ranges, false); 
    64756474} 
     
    65046503 *   <li>ERROR_INVALID_ARGUMENT when either start or end is inside a multi byte line delimiter. 
    65056504 *      Splitting a line delimiter for example by inserting text in between the CR and LF and deleting part of a line delimiter is not supported</li> 
    6506  *   <li>ERROR_NULL_ARGUMENT when string is null</li> 
    65076505 * </ul> 
    65086506 */ 
    65096507public void replaceTextRange(int start, int length, String text) { 
    65106508    checkWidget(); 
    6511     if (text is null) { 
    6512         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    6513     } 
     6509    // DWT extension: allow null string 
     6510    //if (text is null) { 
     6511    //    DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     6512    //} 
    65146513    int contentLength = getCharCount(); 
    65156514    int end = start + length; 
     
    79277926 * </ul> 
    79287927 * @exception IllegalArgumentException <ul> 
    7929  *    <li>ERROR_NULL_ARGUMENT when an element in the styles array is null</li> 
    79307928 *    <li>ERROR_INVALID_RANGE when the number of ranges and style do not match (ranges.length * 2 is styles.length)</li> 
    79317929 *    <li>ERROR_INVALID_RANGE when a range is outside the valid range (> getCharCount() or less than zero)</li> 
     
    79697967 * </ul> 
    79707968 * @exception IllegalArgumentException <ul> 
    7971  *    <li>ERROR_NULL_ARGUMENT when an element in the styles array is null</li> 
    79727969 *    <li>ERROR_INVALID_RANGE when the number of ranges and style do not match (ranges.length * 2 is styles.length)</li> 
    79737970 *    <li>ERROR_INVALID_RANGE when a range is outside the valid range (> getCharCount() or less than zero)</li> 
     
    80978094 * </ul> 
    80988095 * @exception IllegalArgumentException <ul> 
    8099  *    <li>ERROR_NULL_ARGUMENT when the list of ranges is null</li> 
    81008096 *    <li>ERROR_INVALID_RANGE when the last of the style ranges is outside the valid range (> getCharCount())</li> 
    81018097 * </ul> 
     
    81068102    checkWidget(); 
    81078103    if (isListening(LineGetStyle)) return; 
    8108     if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     8104    // DWT extension: allow null array 
     8105    //if (ranges is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    81098106    setStyleRanges(0, 0, null, ranges, true); 
    81108107} 
     
    81448141 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 
    81458142 * </ul> 
    8146  * @exception IllegalArgumentException <ul> 
    8147  *    <li>ERROR_NULL_ARGUMENT when string is null</li> 
    8148  * </ul> 
    81498143 */ 
    81508144public void setText(String text) { 
    81518145    checkWidget(); 
    8152     if (text is null) { 
    8153         DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    8154     } 
     8146    // DWT extension: allow null string 
     8147    //if (text is null) { 
     8148    //    DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     8149    //} 
    81558150    Event event = new Event(); 
    81568151    event.start = 0; 
  • dwt/custom/TableTree.d

    r212 r244  
    766766 * 
    767767 * @exception IllegalArgumentException <ul> 
    768  *    <li>ERROR_NULL_ARGUMENT - if the array of items is null</li> 
    769768 *    <li>ERROR_INVALID_ARGUMENT - if one of the item has been disposed</li> 
    770769 * </ul> 
     
    778777public void setSelection (TableTreeItem[] items) { 
    779778    checkWidget (); 
    780     if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
     779    // DWT extension: allow null array 
     780    //if (items is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); 
    781781    int length = items.length; 
    782782    if (length is 0 || ((table.getStyle() & DWT.SINGLE) !is 0 && length > 1)) { 
  • dwt/custom/TableTreeItem.d

    r213 r244  
    820820 * @param text the new text 
    821821 * 
    822  * @exception IllegalArgumentException <ul> 
    823  *    <li>ERROR_NULL_ARGUMENT - if the text is null</li> 
    824  * </ul> 
    825822 * @exception DWTException <ul> 
    826823 *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> 
     
    830827public void setText(int index, String text) { 
    831828    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); 
    833831    int columnCount = Math.max(parent.getTable().getColumnCount(), 1); 
    834832    if (index < 0 || index >= columnCount) return;