Are VIRTUAL GridTableViewer supposed to work? [message #1799520] |
Sat, 08 December 2018 09:48  |
Linuxhippy Mising name Messages: 72 Registered: July 2009 |
Member |
|
|
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 #1799545 is a reply to message #1799520] |
Sun, 09 December 2018 20:04   |
Eclipse User |
|
|
|
Not sure why the items aren't being resolved when it's virtual.
But if you tell the Grid to expand to the full size required to hold all it's input, it's going to load all the records as they're all visible.
Isn't that what's going to happen if you contain it in a scrollable composite? The scrollable composite will allow it's client to be as large as it want to be.
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04548 seconds