diff options
author | Veronika Irvine | 2003-08-22 15:55:40 +0000 |
---|---|---|
committer | Veronika Irvine | 2003-08-22 15:55:40 +0000 |
commit | b5578d8fcbe3c95cdfc0eb798dac5793c669314e (patch) | |
tree | 7d4fa46409fb1a027ac393c6175f3a088c6d6f5f | |
parent | f7f20f1fb1b5cdefebc5aa8dc5094e62cf4051c9 (diff) | |
download | eclipse.platform.swt-b5578d8fcbe3c95cdfc0eb798dac5793c669314e.tar.gz eclipse.platform.swt-b5578d8fcbe3c95cdfc0eb798dac5793c669314e.tar.xz eclipse.platform.swt-b5578d8fcbe3c95cdfc0eb798dac5793c669314e.zip |
Adding support to modify individual cell colors
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TableItem.java | 26 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java | 34 |
2 files changed, 20 insertions, 40 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TableItem.java index ad369dce07..a8788ae470 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TableItem.java @@ -150,9 +150,6 @@ public Color getBackground () { * @param index the column index * @return the background color * - * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_Range - if the column index is invalid</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -162,9 +159,8 @@ public Color getBackground () { */ public Color getBackground (int index) { checkWidget (); - if (0 > index || index >= parent.getColumnCount ()) { - error (SWT.ERROR_INVALID_RANGE); - } + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return getBackground (); // TODO return getBackground (); } @@ -244,9 +240,6 @@ public Color getForeground () { * @param index the column index * @return the foreground color * - * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_Range - if the column index is invalid</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -256,9 +249,8 @@ public Color getForeground () { */ public Color getForeground (int index) { checkWidget (); - if (0 > index || index >= parent.getColumnCount ()) { - error (SWT.ERROR_INVALID_RANGE); - } + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return getForeground (); // TODO return getForeground (); } @@ -466,9 +458,8 @@ public void setBackground (int index, Color color) { if (color != null && color.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } - if (0 > index || index >= parent.getColumnCount ()) { - error (SWT.ERROR_INVALID_RANGE); - } + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return; // TODO } @@ -541,9 +532,8 @@ public void setForeground (int index, Color color){ if (color != null && color.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } - if (0 > index || index >= parent.getColumnCount()) { - error (SWT.ERROR_INVALID_RANGE); - } + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return; // TODO } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java index af53aefe09..49b5922e99 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TableItem.java @@ -289,9 +289,6 @@ public Color getBackground(){ * @param index the column index * @return the background color * - * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_Range - if the column index is invalid</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -301,10 +298,9 @@ public Color getBackground(){ */ public Color getBackground (int index) { checkWidget (); - Table parent = getParent(); - if (0 > index || index >= parent.getColumnCount ()) { - error (SWT.ERROR_INVALID_RANGE); - } + Table parent = getParent (); + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return getBackground (); // TODO return getBackground (); } @@ -448,9 +444,6 @@ public Color getForeground(){ * @param index the column index * @return the foreground color * - * @exception IllegalArgumentException <ul> - * <li>ERROR_INVALID_Range - if the column index is invalid</li> - * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> @@ -460,10 +453,9 @@ public Color getForeground(){ */ public Color getForeground (int index) { checkWidget (); - Table parent = getParent(); - if (0 > index || index >= parent.getColumnCount ()) { - error (SWT.ERROR_INVALID_RANGE); - } + Table parent = getParent (); + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return getForeground (); // TODO return getForeground (); } @@ -1117,10 +1109,9 @@ public void setBackground (int index, Color color) { if (color != null && color.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } - Table parent = getParent(); - if (0 > index || index >= parent.getColumnCount ()) { - error (SWT.ERROR_INVALID_RANGE); - } + Table parent = getParent (); + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return; // TODO } /** @@ -1172,10 +1163,9 @@ public void setForeground (int index, Color color){ if (color != null && color.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } - Table parent = getParent(); - if (0 > index || index >= parent.getColumnCount()) { - error (SWT.ERROR_INVALID_RANGE); - } + Table parent = getParent (); + int count = parent.getColumnCount (); + if (0 > index || index > (count == 0 ? 0 : count -1 )) return; // TODO } /** |