Are VIRTUAL GridTableViewer supposed to work? [message #1799520] |
Sat, 08 December 2018 04:48  |
Eclipse User |
|
|
|
Hi,
I wonder - are virtual GridTableViewers supposed to work with RAP?
Virtual Tables work perfectly fine, however with GridTableViewers I haven't had much luck.
With the snippit I can observe the following behaviour:
* if the setMinSize call is commented out, I get the lazy-loading dots "..." as soon as I start scroling, but those are never resolved
* in case I make the call to setMinSize active, the GridTableViewer behaves actually non-virtual. All elements are loaded, with 10000 entries the browser tab is unresponsive.
public void createContent(Composite parent) {
final int INITIAL_INPUT_SIZE = 10000;
ScrolledComposite comp = new ScrolledComposite(parent, SWT.VERTICAL);
comp.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
final GridTableViewer gridTableViewer = new GridTableViewer(comp, SWT.VIRTUAL);
gridTableViewer.setContentProvider(ArrayContentProvider.getInstance());
GridColumn gridColumn = new GridColumn(gridTableViewer.getGrid(), SWT.NONE);
gridColumn.setWidth(200);
final Object[] input = new Object[INITIAL_INPUT_SIZE];
for(int item = 0; item < input.length; item++) {
input[item] = "Item " + item;
}
gridTableViewer.setInput(input);
comp.setContent(gridTableViewer.getGrid());
comp.setExpandHorizontal(true);
comp.setExpandVertical(true);
//comp.setMinSize(gridTableViewer.getGrid().computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
|
|
|
|
Re: Are VIRTUAL GridTableViewer supposed to work? [message #1800265 is a reply to message #1799545] |
Sat, 22 December 2018 05:21  |
Eclipse User |
|
|
|
Hi Chris,
> Not sure why the items aren't being resolved when it's virtual.
It seems when it is created without SWT.VERTICAL, scrolling is possible but items are not lazily loaded (instead the dots are displayed). This made me believe lazy-loading is somehow broken.
> For a virtual table to work properly, the table need to manage its own scrolling.
> You should be giving it a SWT.V_SCROLL at least.
Makes sense, now everything works as expected.
Thanks a lot, Clemens
|
|
|
Powered by
FUDForum. Page generated in 0.04580 seconds