Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TableViewer SWT.VIRTUAL
TableViewer SWT.VIRTUAL [message #451444] Wed, 02 March 2005 13:44 Go to next message
Stefano Zaccaria is currently offline Stefano ZaccariaFriend
Messages: 48
Registered: July 2009
Member
Hello to all,
Can any body help me with TableViewer and SWT.VIRTUAL.

I want to use a large table ( 100.000 rows ) in my program, but when I use
the Jface TableViewer the load of the table is very slow.
I read that whit the TableViewer SWT.VIRTUAL, the load is too fast. I try
put the SWT.VIRTUAL in the defition of the table, but it not fuction very
well. If some body give me a litle piece of code I very grateful to him.

Thank very much.

Stefano
Re: TableViewer SWT.VIRTUAL [message #451454 is a reply to message #451444] Wed, 02 March 2005 16:09 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Support for TableViewer with the style SWT.VIRTUAL was added in 3.1 M5.
Take a look at ILazyContentProvider and DeferredContentProvider
I only work on the SWT side, not on the JFace side so I can't help very
much. The best place to get answers about JFace API is in the
eclipse.platform newsgroup.
news://news.eclipse.org/eclipse.platform
I poked around Eclipse and could not find an example in the plugins
themselves but I did find a test application that uses the new
ILazyContentProvider.
For example, in the plugin org.eclipse.ui.tests (You need to check this out
of CVS, I did not see it included in any downloads - has lots of simple
examples of using JFace API) look at the class
org.jface.tests.viewers.TestLazyModelContentProvider:

/*********************************************************** ********************
* Copyright (c) 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying material
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
************************************************************ *******************/
package org.eclipse.jface.tests.viewers;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ILazyContentProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
/**
* The TestLazyModelContentProvider is the lazy version
* of the model content provider.
*/
public class TestLazyModelContentProvider extends TestModelContentProvider
implements ILazyContentProvider, IContentProvider {
TableViewerTest test;
TestElement input;
TestLazyModelContentProvider(TableViewerTest testObject){
test = testObject;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILazyContentProvider#updateElement s(int,
int)
*/
public void updateElement(int index) {
if(input == null)
return; //Nothing to update yet
((TableViewer) test.fViewer).replace(input.getChildAt(index), index);
}
/* (non-Javadoc)
* @see org.eclipse.jface.tests.viewers.TestModelContentProvider#dis pose()
*/
public void dispose() {
super.dispose();
}
/* (non-Javadoc)
* @see
org.eclipse.jface.tests.viewers.TestModelContentProvider#inp utChanged(org.eclipse.jface.viewers.Viewer,
java.lang.Object, java.lang.Object)
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
input = (TestElement) newInput;
super.inputChanged(viewer, oldInput, newInput);
}
/* (non-Javadoc)
* @see
org.eclipse.jface.tests.viewers.TestModelContentProvider#get Elements(java.lang.Object)
*/
public Object[] getElements(Object element) {
Assert.isTrue(false,"Should not ever call getElements if lazy");
return super.getElements(element);
}
}

"Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message
news:d04g25$1tv$1@www.eclipse.org...
> Hello to all,
> Can any body help me with TableViewer and SWT.VIRTUAL.
>
> I want to use a large table ( 100.000 rows ) in my program, but when I use
> the Jface TableViewer the load of the table is very slow.
> I read that whit the TableViewer SWT.VIRTUAL, the load is too fast. I try
> put the SWT.VIRTUAL in the defition of the table, but it not fuction very
> well. If some body give me a litle piece of code I very grateful to him.
>
> Thank very much.
>
> Stefano
>
>
Re: TableViewer SWT.VIRTUAL [message #451457 is a reply to message #451454] Wed, 02 March 2005 16:31 Go to previous message
Stefano Zaccaria is currently offline Stefano ZaccariaFriend
Messages: 48
Registered: July 2009
Member
Thaks, thanks, thanks

You are very good girl!!!

I don't have any words that can explane my happynes!!!

Thanks

Non ho parole per esprimere la mia gratitudine, grazie mille Veronika.
Ciao
Stefano


"Veronika Irvine" <veronika_irvine@oti.com> ha scritto nel messaggio
news:d04og2$jv2$3@www.eclipse.org...
> Support for TableViewer with the style SWT.VIRTUAL was added in 3.1 M5.
> Take a look at ILazyContentProvider and DeferredContentProvider
> I only work on the SWT side, not on the JFace side so I can't help very
> much. The best place to get answers about JFace API is in the
> eclipse.platform newsgroup.
> news://news.eclipse.org/eclipse.platform
> I poked around Eclipse and could not find an example in the plugins
> themselves but I did find a test application that uses the new
> ILazyContentProvider.
> For example, in the plugin org.eclipse.ui.tests (You need to check this
> out
> of CVS, I did not see it included in any downloads - has lots of simple
> examples of using JFace API) look at the class
> org.jface.tests.viewers.TestLazyModelContentProvider:
>
> /*********************************************************** ********************
> * Copyright (c) 2005 IBM Corporation and others.
> * All rights reserved. This program and the accompanying material
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
> ************************************************************ *******************/
> package org.eclipse.jface.tests.viewers;
> import org.eclipse.jface.util.Assert;
> import org.eclipse.jface.viewers.IContentProvider;
> import org.eclipse.jface.viewers.ILazyContentProvider;
> import org.eclipse.jface.viewers.TableViewer;
> import org.eclipse.jface.viewers.Viewer;
> /**
> * The TestLazyModelContentProvider is the lazy version
> * of the model content provider.
> */
> public class TestLazyModelContentProvider extends TestModelContentProvider
> implements ILazyContentProvider, IContentProvider {
> TableViewerTest test;
> TestElement input;
> TestLazyModelContentProvider(TableViewerTest testObject){
> test = testObject;
> }
> /* (non-Javadoc)
> * @see org.eclipse.jface.viewers.ILazyContentProvider#updateElement s(int,
> int)
> */
> public void updateElement(int index) {
> if(input == null)
> return; //Nothing to update yet
> ((TableViewer) test.fViewer).replace(input.getChildAt(index), index);
> }
> /* (non-Javadoc)
> * @see org.eclipse.jface.tests.viewers.TestModelContentProvider#dis pose()
> */
> public void dispose() {
> super.dispose();
> }
> /* (non-Javadoc)
> * @see
> org.eclipse.jface.tests.viewers.TestModelContentProvider#inp utChanged(org.eclipse.jface.viewers.Viewer,
> java.lang.Object, java.lang.Object)
> */
> public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
> {
> input = (TestElement) newInput;
> super.inputChanged(viewer, oldInput, newInput);
> }
> /* (non-Javadoc)
> * @see
> org.eclipse.jface.tests.viewers.TestModelContentProvider#get Elements(java.lang.Object)
> */
> public Object[] getElements(Object element) {
> Assert.isTrue(false,"Should not ever call getElements if lazy");
> return super.getElements(element);
> }
> }
>
> "Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message
> news:d04g25$1tv$1@www.eclipse.org...
>> Hello to all,
>> Can any body help me with TableViewer and SWT.VIRTUAL.
>>
>> I want to use a large table ( 100.000 rows ) in my program, but when I
>> use
>> the Jface TableViewer the load of the table is very slow.
>> I read that whit the TableViewer SWT.VIRTUAL, the load is too fast. I try
>> put the SWT.VIRTUAL in the defition of the table, but it not fuction very
>> well. If some body give me a litle piece of code I very grateful to him.
>>
>> Thank very much.
>>
>> Stefano
>>
>>
>
>
Previous Topic:Class cast from ISelection to IStructuredSelection in IObjectActionDelegate.selectionChanged()
Next Topic:How to get windows message
Goto Forum:
  


Current Time: Thu Apr 25 10:16:29 GMT 2024

Powered by FUDForum. Page generated in 0.02892 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top