KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > custom > TableCursor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.custom;
12
13 import org.eclipse.swt.*;
14 import org.eclipse.swt.graphics.*;
15 import org.eclipse.swt.widgets.*;
16 import org.eclipse.swt.events.*;
17
18 /**
19  * A TableCursor provides a way for the user to navigate around a Table
20  * using the keyboard. It also provides a mechanism for selecting an
21  * individual cell in a table.
22  *
23  * <p> Here is an example of using a TableCursor to navigate to a cell and then edit it.
24  *
25  * <code><pre>
26  * public static void main(String[] args) {
27  * Display display = new Display();
28  * Shell shell = new Shell(display);
29  * shell.setLayout(new GridLayout());
30  *
31  * // create a a table with 3 columns and fill with data
32  * final Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
33  * table.setLayoutData(new GridData(GridData.FILL_BOTH));
34  * TableColumn column1 = new TableColumn(table, SWT.NONE);
35  * TableColumn column2 = new TableColumn(table, SWT.NONE);
36  * TableColumn column3 = new TableColumn(table, SWT.NONE);
37  * for (int i = 0; i &lt; 100; i++) {
38  * TableItem item = new TableItem(table, SWT.NONE);
39  * item.setText(new String[] { "cell "+i+" 0", "cell "+i+" 1", "cell "+i+" 2"});
40  * }
41  * column1.pack();
42  * column2.pack();
43  * column3.pack();
44  *
45  * // create a TableCursor to navigate around the table
46  * final TableCursor cursor = new TableCursor(table, SWT.NONE);
47  * // create an editor to edit the cell when the user hits "ENTER"
48  * // while over a cell in the table
49  * final ControlEditor editor = new ControlEditor(cursor);
50  * editor.grabHorizontal = true;
51  * editor.grabVertical = true;
52  *
53  * cursor.addSelectionListener(new SelectionAdapter() {
54  * // when the TableEditor is over a cell, select the corresponding row in
55  * // the table
56  * public void widgetSelected(SelectionEvent e) {
57  * table.setSelection(new TableItem[] {cursor.getRow()});
58  * }
59  * // when the user hits "ENTER" in the TableCursor, pop up a text editor so that
60  * // they can change the text of the cell
61  * public void widgetDefaultSelected(SelectionEvent e){
62  * final Text text = new Text(cursor, SWT.NONE);
63  * TableItem row = cursor.getRow();
64  * int column = cursor.getColumn();
65  * text.setText(row.getText(column));
66  * text.addKeyListener(new KeyAdapter() {
67  * public void keyPressed(KeyEvent e) {
68  * // close the text editor and copy the data over
69  * // when the user hits "ENTER"
70  * if (e.character == SWT.CR) {
71  * TableItem row = cursor.getRow();
72  * int column = cursor.getColumn();
73  * row.setText(column, text.getText());
74  * text.dispose();
75  * }
76  * // close the text editor when the user hits "ESC"
77  * if (e.character == SWT.ESC) {
78  * text.dispose();
79  * }
80  * }
81  * });
82  * editor.setEditor(text);
83  * text.setFocus();
84  * }
85  * });
86  * // Hide the TableCursor when the user hits the "MOD1" or "MOD2" key.
87  * // This allows the user to select multiple items in the table.
88  * cursor.addKeyListener(new KeyAdapter() {
89  * public void keyPressed(KeyEvent e) {
90  * if (e.keyCode == SWT.MOD1 ||
91  * e.keyCode == SWT.MOD2 ||
92  * (e.stateMask & SWT.MOD1) != 0 ||
93  * (e.stateMask & SWT.MOD2) != 0) {
94  * cursor.setVisible(false);
95  * }
96  * }
97  * });
98  * // Show the TableCursor when the user releases the "MOD2" or "MOD1" key.
99  * // This signals the end of the multiple selection task.
100  * table.addKeyListener(new KeyAdapter() {
101  * public void keyReleased(KeyEvent e) {
102  * if (e.keyCode == SWT.MOD1 && (e.stateMask & SWT.MOD2) != 0) return;
103  * if (e.keyCode == SWT.MOD2 && (e.stateMask & SWT.MOD1) != 0) return;
104  * if (e.keyCode != SWT.MOD1 && (e.stateMask & SWT.MOD1) != 0) return;
105  * if (e.keyCode != SWT.MOD2 && (e.stateMask & SWT.MOD2) != 0) return;
106  *
107  * TableItem[] selection = table.getSelection();
108  * TableItem row = (selection.length == 0) ? table.getItem(table.getTopIndex()) : selection[0];
109  * table.showItem(row);
110  * cursor.setSelection(row, 0);
111  * cursor.setVisible(true);
112  * cursor.setFocus();
113  * }
114  * });
115  *
116  * shell.open();
117  * while (!shell.isDisposed()) {
118  * if (!display.readAndDispatch())
119  * display.sleep();
120  * }
121  * display.dispose();
122  * }
123  * </pre></code>
124  *
125  * <dl>
126  * <dt><b>Styles:</b></dt>
127  * <dd>BORDER</dd>
128  * <dt><b>Events:</b></dt>
129  * <dd>Selection, DefaultSelection</dd>
130  * </dl>
131  *
132  * @since 2.0
133  *
134  */

135 public class TableCursor extends Canvas {
136     Table table;
137     TableItem row = null;
138     TableColumn column = null;
139     Listener tableListener, resizeListener, disposeItemListener, disposeColumnListener;
140     
141     // By default, invert the list selection colors
142
static final int BACKGROUND = SWT.COLOR_LIST_SELECTION_TEXT;
143     static final int FOREGROUND = SWT.COLOR_LIST_SELECTION;
144
145 /**
146  * Constructs a new instance of this class given its parent
147  * table and a style value describing its behavior and appearance.
148  * <p>
149  * The style value is either one of the style constants defined in
150  * class <code>SWT</code> which is applicable to instances of this
151  * class, or must be built by <em>bitwise OR</em>'ing together
152  * (that is, using the <code>int</code> "|" operator) two or more
153  * of those <code>SWT</code> style constants. The class description
154  * lists the style constants that are applicable to the class.
155  * Style bits are also inherited from superclasses.
156  * </p>
157  *
158  * @param parent a Table control which will be the parent of the new instance (cannot be null)
159  * @param style the style of control to construct
160  *
161  * @exception IllegalArgumentException <ul>
162  * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
163  * </ul>
164  * @exception SWTException <ul>
165  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
166  * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
167  * </ul>
168  *
169  * @see SWT#BORDER
170  * @see Widget#checkSubclass()
171  * @see Widget#getStyle()
172  */

173 public TableCursor(Table parent, int style) {
174     super(parent, style);
175     table = parent;
176     setBackground(null);
177     setForeground(null);
178     
179     Listener listener = new Listener() {
180         public void handleEvent(Event event) {
181             switch (event.type) {
182                 case SWT.Dispose :
183                     dispose(event);
184                     break;
185                 case SWT.FocusIn :
186                 case SWT.FocusOut :
187                     redraw();
188                     break;
189                 case SWT.KeyDown :
190                     keyDown(event);
191                     break;
192                 case SWT.Paint :
193                     paint(event);
194                     break;
195                 case SWT.Traverse : {
196                     event.doit = true;
197                     switch (event.detail) {
198                         case SWT.TRAVERSE_ARROW_NEXT :
199                         case SWT.TRAVERSE_ARROW_PREVIOUS :
200                         case SWT.TRAVERSE_RETURN :
201                             event.doit = false;
202                             break;
203                     }
204                     break;
205                 }
206             }
207         }
208     };
209     int[] events = new int[] {SWT.Dispose, SWT.FocusIn, SWT.FocusOut, SWT.KeyDown, SWT.Paint, SWT.Traverse};
210     for (int i = 0; i < events.length; i++) {
211         addListener(events[i], listener);
212     }
213
214     tableListener = new Listener() {
215         public void handleEvent(Event event) {
216             switch (event.type) {
217                 case SWT.MouseDown :
218                     tableMouseDown(event);
219                     break;
220                 case SWT.FocusIn :
221                     tableFocusIn(event);
222                     break;
223             }
224         }
225     };
226     table.addListener(SWT.FocusIn, tableListener);
227     table.addListener(SWT.MouseDown, tableListener);
228
229     disposeItemListener = new Listener() {
230         public void handleEvent(Event event) {
231             row = null;
232             column = null;
233             _resize();
234         }
235     };
236     disposeColumnListener = new Listener() {
237         public void handleEvent(Event event) {
238             row = null;
239             column = null;
240             _resize();
241         }
242     };
243     resizeListener = new Listener() {
244         public void handleEvent(Event event) {
245             _resize();
246         }
247     };
248     ScrollBar hBar = table.getHorizontalBar();
249     if (hBar != null) {
250         hBar.addListener(SWT.Selection, resizeListener);
251     }
252     ScrollBar vBar = table.getVerticalBar();
253     if (vBar != null) {
254         vBar.addListener(SWT.Selection, resizeListener);
255     }
256 }
257
258 /**
259  * Adds the listener to the collection of listeners who will
260  * be notified when the user changes the receiver's selection, by sending
261  * it one of the messages defined in the <code>SelectionListener</code>
262  * interface.
263  * <p>
264  * When <code>widgetSelected</code> is called, the item field of the event object is valid.
265  * If the receiver has <code>SWT.CHECK</code> style set and the check selection changes,
266  * the event object detail field contains the value <code>SWT.CHECK</code>.
267  * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
268  * </p>
269  *
270  * @param listener the listener which should be notified when the user changes the receiver's selection
271  *
272  * @exception IllegalArgumentException <ul>
273  * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
274  * </ul>
275  * @exception SWTException <ul>
276  * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
277  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
278  * </ul>
279  *
280  * @see SelectionListener
281  * @see SelectionEvent
282  * @see #removeSelectionListener(SelectionListener)
283  *
284  */

285 public void addSelectionListener(SelectionListener listener) {
286     checkWidget();
287     if (listener == null)
288         SWT.error(SWT.ERROR_NULL_ARGUMENT);
289     TypedListener typedListener = new TypedListener(listener);
290     addListener(SWT.Selection, typedListener);
291     addListener(SWT.DefaultSelection, typedListener);
292 }
293
294 void dispose(Event event) {
295     table.removeListener(SWT.FocusIn, tableListener);
296     table.removeListener(SWT.MouseDown, tableListener);
297     if (column != null) {
298         column.removeListener(SWT.Dispose, disposeColumnListener);
299         column.removeListener(SWT.Move, resizeListener);
300         column.removeListener(SWT.Resize, resizeListener);
301         column = null;
302     }
303     if (row != null) {
304         row.removeListener(SWT.Dispose, disposeItemListener);
305         row = null;
306     }
307     ScrollBar hBar = table.getHorizontalBar();
308     if (hBar != null) {
309         hBar.removeListener(SWT.Selection, resizeListener);
310     }
311     ScrollBar vBar = table.getVerticalBar();
312     if (vBar != null) {
313         vBar.removeListener(SWT.Selection, resizeListener);
314     }
315 }
316
317 void keyDown(Event event) {
318     if (row == null) return;
319     switch (event.character) {
320         case SWT.CR :
321             notifyListeners(SWT.DefaultSelection, new Event());
322             return;
323     }
324     int rowIndex = table.indexOf(row);
325     int columnIndex = column == null ? 0 : table.indexOf(column);
326     switch (event.keyCode) {
327         case SWT.ARROW_UP :
328             setRowColumn(Math.max(0, rowIndex - 1), columnIndex, true);
329             break;
330         case SWT.ARROW_DOWN :
331             setRowColumn(Math.min(rowIndex + 1, table.getItemCount() - 1), columnIndex, true);
332             break;
333         case SWT.ARROW_LEFT :
334         case SWT.ARROW_RIGHT :
335             {
336                 int columnCount = table.getColumnCount();
337                 if (columnCount == 0) break;
338                 int[] order = table.getColumnOrder();
339                 int index = 0;
340                 while (index < order.length) {
341                     if (order[index] == columnIndex) break;
342                     index++;
343                 }
344                 if (index == order.length) index = 0;
345                 int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
346                 if (event.keyCode == leadKey) {
347                    setRowColumn(rowIndex, order[Math.max(0, index - 1)], true);
348                 } else {
349                    setRowColumn(rowIndex, order[Math.min(columnCount - 1, index + 1)], true);
350                 }
351                 break;
352             }
353         case SWT.HOME :
354             setRowColumn(0, columnIndex, true);
355             break;
356         case SWT.END :
357             {
358                 int i = table.getItemCount() - 1;
359                 setRowColumn(i, columnIndex, true);
360                 break;
361             }
362         case SWT.PAGE_UP :
363             {
364                 int index = table.getTopIndex();
365                 if (index == rowIndex) {
366                     Rectangle rect = table.getClientArea();
367                     TableItem item = table.getItem(index);
368                     Rectangle itemRect = item.getBounds(0);
369                     rect.height -= itemRect.y;
370                     int height = table.getItemHeight();
371                     int page = Math.max(1, rect.height / height);
372                     index = Math.max(0, index - page + 1);
373                 }
374                 setRowColumn(index, columnIndex, true);
375                 break;
376             }
377         case SWT.PAGE_DOWN :
378             {
379                 int index = table.getTopIndex();
380                 Rectangle rect = table.getClientArea();
381                 TableItem item = table.getItem(index);
382                 Rectangle itemRect = item.getBounds(0);
383                 rect.height -= itemRect.y;
384                 int height = table.getItemHeight();
385                 int page = Math.max(1, rect.height / height);
386                 int end = table.getItemCount() - 1;
387                 index = Math.min(end, index + page - 1);
388                 if (index == rowIndex) {
389                     index = Math.min(end, index + page - 1);
390                 }
391                 setRowColumn(index, columnIndex, true);
392                 break;
393             }
394     }
395 }
396
397 void paint(Event event) {
398     if (row == null) return;
399     int columnIndex = column == null ? 0 : table.indexOf(column);
400     GC gc = event.gc;
401     Display display = getDisplay();
402     gc.setBackground(getBackground());
403     gc.setForeground(getForeground());
404     gc.fillRectangle(event.x, event.y, event.width, event.height);
405     int x = 0;
406     Point size = getSize();
407     Image image = row.getImage(columnIndex);
408     if (image != null) {
409         Rectangle imageSize = image.getBounds();
410         int imageY = (size.y - imageSize.height) / 2;
411         gc.drawImage(image, x, imageY);
412         x += imageSize.width;
413     }
414     String JavaDoc text = row.getText(columnIndex);
415     if (text.length() > 0) {
416         Rectangle bounds = row.getBounds(columnIndex);
417         Point extent = gc.stringExtent(text);
418         // Temporary code - need a better way to determine table trim
419
String JavaDoc platform = SWT.getPlatform();
420         if ("win32".equals(platform)) { //$NON-NLS-1$
421
if (table.getColumnCount() == 0 || columnIndex == 0) {
422                 x += 2;
423             } else {
424                 int alignmnent = column.getAlignment();
425                 switch (alignmnent) {
426                     case SWT.LEFT:
427                         x += 6;
428                         break;
429                     case SWT.RIGHT:
430                         x = bounds.width - extent.x - 6;
431                         break;
432                     case SWT.CENTER:
433                         x += (bounds.width - x - extent.x) / 2;
434                         break;
435                 }
436             }
437         } else {
438             if (table.getColumnCount() == 0) {
439                 x += 5;
440             } else {
441                 int alignmnent = column.getAlignment();
442                 switch (alignmnent) {
443                     case SWT.LEFT:
444                         x += 5;
445                         break;
446                     case SWT.RIGHT:
447                         x = bounds.width- extent.x - 2;
448                         break;
449                     case SWT.CENTER:
450                         x += (bounds.width - x - extent.x) / 2 + 2;
451                         break;
452                 }
453             }
454         }
455         int textY = (size.y - extent.y) / 2;
456         gc.drawString(text, x, textY);
457     }
458     if (isFocusControl()) {
459         gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
460         gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
461         gc.drawFocus(0, 0, size.x, size.y);
462     }
463 }
464
465 void tableFocusIn(Event event) {
466     if (isDisposed())
467         return;
468     if (isVisible())
469         setFocus();
470 }
471
472 void tableMouseDown(Event event) {
473     if (isDisposed() || !isVisible()) return;
474     Point pt = new Point(event.x, event.y);
475     int lineWidth = table.getLinesVisible() ? table.getGridLineWidth() : 0;
476     TableItem item = table.getItem(pt);
477     if ((table.getStyle() & SWT.FULL_SELECTION) != 0) {
478         if (item == null) return;
479     } else {
480         int start = item != null ? table.indexOf(item) : table.getTopIndex();
481         int end = table.getItemCount();
482         Rectangle clientRect = table.getClientArea();
483         for (int i = start; i < end; i++) {
484             TableItem nextItem = table.getItem(i);
485             Rectangle rect = nextItem.getBounds(0);
486             if (pt.y >= rect.y && pt.y < rect.y + rect.height + lineWidth) {
487                 item = nextItem;
488                 break;
489             }
490             if (rect.y > clientRect.y + clientRect.height) return;
491         }
492         if (item == null) return;
493     }
494     TableColumn newColumn = null;
495     int columnCount = table.getColumnCount();
496     if (columnCount > 0) {
497         for (int i = 0; i < columnCount; i++) {
498             Rectangle rect = item.getBounds(i);
499             rect.width += lineWidth;
500             rect.height += lineWidth;
501             if (rect.contains(pt)) {
502                 newColumn = table.getColumn(i);
503                 break;
504             }
505         }
506         if (newColumn == null) {
507             newColumn = table.getColumn(0);
508         }
509     }
510     setRowColumn(item, newColumn, true);
511     setFocus();
512     return;
513 }
514 void setRowColumn(int row, int column, boolean notify) {
515     TableItem item = row == -1 ? null : table.getItem(row);
516     TableColumn col = column == -1 || table.getColumnCount() == 0 ? null : table.getColumn(column);
517     setRowColumn(item, col, notify);
518 }
519 void setRowColumn(TableItem row, TableColumn column, boolean notify) {
520     if (this.row == row && this.column == column) {
521         return;
522     }
523     if (this.row != null && this.row != row) {
524         this.row.removeListener(SWT.Dispose, disposeItemListener);
525         this.row = null;
526     }
527     if (this.column != null && this.column != column) {
528         this.column.removeListener(SWT.Dispose, disposeColumnListener);
529         this.column.removeListener(SWT.Move, resizeListener);
530         this.column.removeListener(SWT.Resize, resizeListener);
531         this.column = null;
532     }
533     if (row != null) {
534         if (this.row != row) {
535             this.row = row;
536             row.addListener(SWT.Dispose, disposeItemListener);
537             table.showItem(row);
538         }
539         if (this.column != column && column != null) {
540             this.column = column;
541             column.addListener(SWT.Dispose, disposeColumnListener);
542             column.addListener(SWT.Move, resizeListener);
543             column.addListener(SWT.Resize, resizeListener);
544             table.showColumn(column);
545         }
546         int columnIndex = column == null ? 0 : table.indexOf(column);
547         setBounds(row.getBounds(columnIndex));
548         redraw();
549         if (notify) {
550             notifyListeners(SWT.Selection, new Event());
551         }
552     }
553 }
554
555 public void setVisible(boolean visible) {
556     checkWidget();
557     if (visible) _resize();
558     super.setVisible(visible);
559 }
560
561 /**
562  * Removes the listener from the collection of listeners who will
563  * be notified when the user changes the receiver's selection.
564  *
565  * @param listener the listener which should no longer be notified
566  *
567  * @exception IllegalArgumentException <ul>
568  * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
569  * </ul>
570  * @exception SWTException <ul>
571  * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
572  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
573  * </ul>
574  *
575  * @see SelectionListener
576  * @see #addSelectionListener(SelectionListener)
577  *
578  * @since 3.0
579  */

580 public void removeSelectionListener(SelectionListener listener) {
581     checkWidget();
582     if (listener == null) {
583         SWT.error(SWT.ERROR_NULL_ARGUMENT);
584     }
585     removeListener(SWT.Selection, listener);
586     removeListener(SWT.DefaultSelection, listener);
587 }
588
589 void _resize() {
590     if (row == null) {
591         setBounds(-200, -200, 0, 0);
592     } else {
593         int columnIndex = column == null ? 0 : table.indexOf(column);
594         setBounds(row.getBounds(columnIndex));
595     }
596 }
597 /**
598  * Returns the column over which the TableCursor is positioned.
599  *
600  * @return the column for the current position
601  *
602  * @exception SWTException <ul>
603  * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
604  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
605  * </ul>
606  */

607 public int getColumn() {
608     checkWidget();
609     return column == null ? 0 : table.indexOf(column);
610 }
611 /**
612  * Returns the row over which the TableCursor is positioned.
613  *
614  * @return the item for the current position
615  *
616  * @exception SWTException <ul>
617  * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
618  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
619  * </ul>
620  */

621 public TableItem getRow() {
622     checkWidget();
623     return row;
624 }
625 public void setBackground (Color color) {
626     if (color == null) color = getDisplay().getSystemColor(BACKGROUND);
627     super.setBackground(color);
628     redraw();
629 }
630 public void setForeground (Color color) {
631     if (color == null) color = getDisplay().getSystemColor(FOREGROUND);
632     super.setForeground(color);
633     redraw();
634 }
635 /**
636  * Positions the TableCursor over the cell at the given row and column in the parent table.
637  *
638  * @param row the index of the row for the cell to select
639  * @param column the index of column for the cell to select
640  *
641  * @exception SWTException <ul>
642  * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
643  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
644  * </ul>
645  *
646  */

647 public void setSelection(int row, int column) {
648     checkWidget();
649     int columnCount = table.getColumnCount();
650     int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
651     if (row < 0
652         || row >= table.getItemCount()
653         || column < 0
654         || column > maxColumnIndex)
655         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
656     setRowColumn(row, column, false);
657 }
658 /**
659  * Positions the TableCursor over the cell at the given row and column in the parent table.
660  *
661  * @param row the TableItem of the row for the cell to select
662  * @param column the index of column for the cell to select
663  *
664  * @exception SWTException <ul>
665  * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
666  * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
667  * </ul>
668  *
669  */

670 public void setSelection(TableItem row, int column) {
671     checkWidget();
672     int columnCount = table.getColumnCount();
673     int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
674     if (row == null
675         || row.isDisposed()
676         || column < 0
677         || column > maxColumnIndex)
678         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
679     setRowColumn(table.indexOf(row), column, false);
680 }
681 }
682
Popular Tags