Lines 27-32
Link Here
|
27 |
public class TableItem extends Item { |
27 |
public class TableItem extends Item { |
28 |
Table parent; |
28 |
Table parent; |
29 |
|
29 |
|
|
|
30 |
Color bgColor = null; |
31 |
Color frColor = null; |
32 |
|
33 |
|
30 |
/** |
34 |
/** |
31 |
* Constructs a new instance of this class given its parent |
35 |
* Constructs a new instance of this class given its parent |
32 |
* (which must be a <code>Table</code>) and a style value |
36 |
* (which must be a <code>Table</code>) and a style value |
Lines 103-109
Link Here
|
103 |
protected void checkSubclass () { |
107 |
protected void checkSubclass () { |
104 |
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS); |
108 |
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS); |
105 |
} |
109 |
} |
106 |
|
110 |
/** |
|
|
111 |
* Returns the receiver's background color. |
112 |
* |
113 |
* @return the background color |
114 |
* |
115 |
* @exception SWTException <ul> |
116 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
117 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
118 |
* </ul> |
119 |
*/ |
120 |
public Color getBackground(){ |
121 |
checkWidget(); |
122 |
return bgColor; |
123 |
} |
107 |
/** |
124 |
/** |
108 |
* Returns a rectangle describing the receiver's size and location |
125 |
* Returns a rectangle describing the receiver's size and location |
109 |
* relative to its parent at a column in the table. |
126 |
* relative to its parent at a column in the table. |
Lines 183-188
Link Here
|
183 |
} |
200 |
} |
184 |
|
201 |
|
185 |
/** |
202 |
/** |
|
|
203 |
* Returns the foreground color that the receiver will use to draw. |
204 |
* |
205 |
* @return the receiver's foreground color |
206 |
* |
207 |
* @exception SWTException <ul> |
208 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
209 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
210 |
* </ul> |
211 |
*/ |
212 |
public Color getForeground(){ |
213 |
checkWidget(); |
214 |
return frColor; |
215 |
} |
216 |
|
217 |
/** |
186 |
* Returns <code>true</code> if the receiver is grayed, |
218 |
* Returns <code>true</code> if the receiver is grayed, |
187 |
* and false otherwise. When the parent does not have |
219 |
* and false otherwise. When the parent does not have |
188 |
* the <code>CHECK style, return false. |
220 |
* the <code>CHECK style, return false. |
Lines 343-348
Link Here
|
343 |
} |
375 |
} |
344 |
|
376 |
|
345 |
/** |
377 |
/** |
|
|
378 |
* Sets the receiver's background color to the color specified |
379 |
* by the argument, or to the default system color for the item |
380 |
* if the argument is null. |
381 |
* |
382 |
* @param color the new color (or null) |
383 |
* |
384 |
* @exception IllegalArgumentException <ul> |
385 |
* <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
386 |
* </ul> |
387 |
* @exception SWTException <ul> |
388 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
389 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
390 |
* </ul> |
391 |
*/ |
392 |
public void setBackground(Color color){ |
393 |
checkWidget(); |
394 |
if(color != null && color.isDisposed()) |
395 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
396 |
bgColor = color; |
397 |
if(color != null && color.handle != parent.getBackgroundPixel()) |
398 |
parent.hasColorItem = true; |
399 |
} |
400 |
|
401 |
/** |
346 |
* Sets the checked state of the receiver. |
402 |
* Sets the checked state of the receiver. |
347 |
* |
403 |
* |
348 |
* @param checked the new checked state |
404 |
* @param checked the new checked state |
Lines 374-379
Link Here
|
374 |
OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem); |
430 |
OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem); |
375 |
parent.ignoreSelect = false; |
431 |
parent.ignoreSelect = false; |
376 |
} |
432 |
} |
|
|
433 |
|
434 |
/** |
435 |
* Sets the receiver's foreground color to the color specified |
436 |
* by the argument, or to the default system color for the item |
437 |
* if the argument is null. |
438 |
* |
439 |
* @param color the new color (or null) |
440 |
* |
441 |
* @exception IllegalArgumentException <ul> |
442 |
* <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> |
443 |
* </ul> |
444 |
* @exception SWTException <ul> |
445 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
446 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
447 |
* </ul> |
448 |
*/ |
449 |
public void setForeground(Color color){ |
450 |
checkWidget(); |
451 |
if(color != null && color.isDisposed()) |
452 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
453 |
frColor = color; |
454 |
if(color != null && color.handle != parent.getForegroundPixel()) |
455 |
parent.hasColorItem = true; |
456 |
} |
457 |
|
377 |
|
458 |
|
378 |
/** |
459 |
/** |
379 |
* Sets the grayed state of the receiver. |
460 |
* Sets the grayed state of the receiver. |