Community
Participate
Working Groups
When adding new items after having removed all others you'll run into an exception because when removing items the cache-size is not reduced: --------------------8<-------------------- Shell shell=new Shell(Display.getCurrent()); shell.setLayout(new FillLayout()); final TableViewer table=new TableViewer(shell,SWT.VIRTUAL); final Object item="item1"; final Object item2="item2"; final Object item3="item3"; final Object item4="item3"; table.add(item); table.add(item2); table.add(item3); Button b = new Button(shell,SWT.PUSH); b.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent arg0) { } public void widgetSelected(SelectionEvent arg0) { table.remove(item); table.remove(item2); table.remove(item3); } }); b.setText("Remove"); b = new Button(shell,SWT.PUSH); b.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent arg0) { } public void widgetSelected(SelectionEvent arg0) { table.add(item); table.add(item2); table.add(item3); table.add(item4); } }); b.setText("Add"); shell.setVisible(true); while(!shell.isDisposed()) { shell.getDisplay().readAndDispatch(); } --------------------8<--------------------
If I'm not completely mistaken the cache can not work the way it is implemented for now. it will also fail when calling insert(Object element, int position). I ask myself if it wouldn't be wiser to use an arraylist?
Created attachment 42939 [details] Fixes clean up of cache when items removed from viewer This patch fixes the first problem with virtual-tables because it syncs the cache with the table
Created attachment 42943 [details] This also fixes problems with insert I'm sure there's a better solution but its working ;-)
3.2.1 candidate. Thanks Tom!
Well Boris, I think the provided patch is nonsense because it doesn't work when using a ILazyContentProvider. I'll think I need to bang my head against this once more. (In reply to comment #4) > 3.2.1 candidate. Thanks Tom! >
Boris if you are not planning to address this for 3.2.1 you should remove the tag. The release candidates start next week.
I will attach a patch to bug 154755 but leave this one open to track the particular issue reported here. Note that the patch attached to this bugzilla has a bug in the remove case. Unfortunately, there are just too many changes required to fix the problems with VIRTUAL TableViewer so we have to move this to 3.3.
I hope we can get to this in 3.4. In 3.3, I ended up spending so much time on the virtual tree (which is used by Debug) that I never got to look at virtual tables.
Tom, are you still interested in this?
yes move it over to me
multi change because of intenion of stepping back as platform-ui committer
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.