-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I encounter exactly this (closed) issue with RAP 3.29.0:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=396172
The problem is that Table.updateScrollBars() is called for each item that is disposed via Table.destroyItem():

After investigating
org.eclipse.rap/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Table.java
Line 2546 in 70285aa
| if( ( style & SWT.NO_SCROLL ) == 0 ) { |
Field styleField;
try {
styleField = Widget.class.getDeclaredField("style");
styleField.setAccessible(true);
} catch (NoSuchFieldException e) {
styleField = null;
}
var table = ((TableViewer) viewer).getTable();
int style = table.getStyle();
boolean resetStyle = false;
try {
// this is a hack to fix performance issues with RAP
// by prevent scrollbar updates for each destroyed item
if (styleField != null && (style & SWT.NO_SCROLL) == 0) {
try {
styleField.set(table, table.getStyle() | SWT.NO_SCROLL);
resetStyle = true;
} catch (IllegalAccessException e) {
// ignore
}
}
table.setItemCount(children.length);
} finally {
if (resetStyle) {
try {
styleField.set(table, style);
} catch (IllegalAccessException e) {
// ignore
}
}
}Is there anything that can be done to prevent updating the scrollbar state in this situation for each item?
I would propose to simply add some kind of flag isUpdatingItemCount = true that can be checked in Table.updateScrollBars() additionally to the style flag SWT.NO_SCROLL.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels