Community
Participate
Working Groups
In my case i created a new table with 3 columns and column formatters. After rebinding the table with 5 columns and column formatter with index > 3 an IndexOutOfBoundsException is thrown when the table with 5 columns is shown. But after confirming all exceptions with "ok" the table is normally shown. Maybe there is a problem with the TableViewer in this code in method bindUIControl: // try to reuse the table viewer viewer = (AbstractTableViewer) control.getData(TABLE_VIEWER_DATA_KEY); if ((viewer == null) || (viewer.getControl() != control)) { viewer = createTableViewer(); control.setData(TABLE_VIEWER_DATA_KEY, viewer); } It seems, that the table viewer references some old data after reusing it.
Because of a windows bug the space of images (see java comment at the end of this comment) is still reserved after rebinding the TableRdiget and the SWT table. This problem can be fixed by calling the method Table.removeAll during unbinding the UI control. Comment in Table.setTableEmpty: /* * Bug in Windows. When LVM_SETIMAGELIST is used to remove the * image list by setting it to NULL, the item width and height * is not changed and space is reserved for icons despite the * fact that there are none. The fix is to set the image list * to be very small before setting it to NULL. This causes * Windows to reserve the smallest possible space when an image * list is removed. */