| Summary: | [Viewers] Empty rows in CheckboxTableViewer with virtual table | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Ilya <ismagilov> | ||||||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Hitesh <hsoliwal> | ||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | eclipse.felipe, hsoliwal, ismagilov | ||||||||
| Version: | 3.6 | ||||||||||
| Target Milestone: | 3.7 M1 | ||||||||||
| Hardware: | Macintosh | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Ilya
Created attachment 173995 [details]
Snippet for reproducing the bug.
(In reply to comment #0) > Build Identifier: 20100218-1602 > > If setAllChecked(true) is called on CheckboxTableViewer (based on table with > SWT.VIRTUAL flag) and viewer is scrolled down, empty rows are displayed. > Setting item.setChecked(boolean) before the item(s) have been materialized, will prevent SWT.SetData callback from happening. The viewer relies on this callback even if premature. Moving to SWT for comment. (In reply to comment #2) > Setting item.setChecked(boolean) before the item(s) have been materialized, > will prevent SWT.SetData callback from happening. The viewer relies on this > callback even if premature. If the table is virtual you should only call item.set* during the SetData event. If you have to call item.setChecked(boolean) any other time you will need to call table.clear(table.indexOf(item)) to cause the SetData event to happen again. (In reply to comment #3) > > If you have to call item.setChecked(boolean) any other time you will need to > call table.clear(table.indexOf(item)) to cause the SetData event to happen > again. I guess the checked state of the item is cleared off as well in case of a call to Table#clear(..) . It would not serve much purpose; this would need to be fixed in the viewer itself. Created attachment 174049 [details]
Patch V01
Patch Released to CVS HEAD.
Marking as fixed. (In reply to comment #6) > Marking as fixed. Could you please check one more time that attached patch solves this bug? I don`t have prepared environment for Eclipse patching so I created PatchedCheckboxTableViewer as a subclass of CheckboxTableViewer and overrode patched methods with code from patch. I still see unchecked rows after pressing button for selecting all rows and scrolling down. I noticed, that only those rows are displayed as checked which were displayed in visible area of table for one time. For example, if you scroll down for some rows down before pressing button, you see these rows are displayed as checked . Probably, this is Mac-specific bug. Or may be it is not correct to subclass CheckboxTableViewer and override its method. But I made the same with patch from bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=319600 and that bug was solved. I am attaching PatchedCheckboxTableViewer where with code from this and bug 319600 patches. Created attachment 174697 [details]
CheckboxTableViewer patched by overriding methods
(In reply to comment #7) > (In reply to comment #6) > > Marking as fixed. > > Could you please check one more time that attached patch solves this bug? > This is the intended behaviour. Forcing an early materialization of items has a cost and simply beats the purpose of having a Virtual Table.I suggest using an ICheckStateProvider which serves this use-case very well. > I don`t have prepared environment for Eclipse patching so I created > PatchedCheckboxTableViewer as a subclass of CheckboxTableViewer and overrode > patched methods with code from patch. > > I still see unchecked rows after pressing button for selecting all rows and > scrolling down. I noticed, that only those rows are displayed as checked which > were displayed in visible area of table for one time. For example, if you > scroll down for some rows down before pressing button, you see these rows are > displayed as checked . > No, what you notice is exactly what the patch accomplishes. It does not enforce materialization of table items. So we check/uncheck only the items that have already been materialized. > Probably, this is Mac-specific bug. Or may be it is not correct to subclass > CheckboxTableViewer and override its method. But I made the same with patch > from bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=319600 and that bug was > solved. > > I am attaching PatchedCheckboxTableViewer where with code from this and bug > 319600 patches. See Main menu: Help->Help Contents ->Plug-in Development Environment Guide > Tasks > PDE UI Forums are another good place for getting answers to your queries http://www.eclipse.org/forums/ |