IndexOutOfBoundsExceptions on SWT Virtual Tables

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

IndexOutOfBoundsExceptions on SWT Virtual Tables

olarte.andres
I'm getting IndexOutOfBoundsExceptions when an user scrolls down to
the bottom on a SWT Virtual Table.  Here's a brief example:

import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.gui.TableFormat;
import ca.odell.glazedlists.swt.EventTableViewer;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;


public class TestTable {

    public static void main(String[] args) {
       new TestTable().run();
   }

   public void run() {
       Display display = new Display();
       Shell shell = new Shell(display);
       shell.setLayout(new FillLayout());
       Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
       table.setHeaderVisible(true);
       BasicEventList basicList = new BasicEventList();
       for (int i = 0; i < 1000; i++) {
           basicList.add("Item " + i);
       }
       TableFormat tf = new TableFormat() {
           public String getColumnName(int i) {
               return "Colname";
           }

           public Object getColumnValue(Object o, int i) {
               return (String) o;
           }

           public int getColumnCount() {
               return 1;
           }
       };
       EventTableViewer virtualTableViewer = new EventTableViewer(basicList,
               table, tf);
       shell.open();
       while (!shell.isDisposed()) {
           if (!display.readAndDispatch()) {
               display.sleep();
           }
       }
       display.dispose();
   }

}


If you run this example, and the scroll to the bottom, you will get
the Exception.  It seems that the EventTableViewer is not setting the
correct size of the virtual table.  If you remove the SWT.VIRTUAL
flag, you don't get the exception.  I read some mails on other cases
where people where getting this exception, but it was due to other
factors that I don't think relate to this issue.  Any ideas?

Thanks,

Andres

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

Jesse Wilson-2

Hey Andres ---

Thanks for the heads up on this. We've had numerous problems
with support for virtual table under SWT. Fortunately this should
all become simplified as we intend to change our implementation
so that it depends upon JFace's table viewer to do the actual
populating of the table.

SWT's virtual table has caused us huge amounts of grief mostly
due to the toolkit's handing of selection, and I imagine that a lot
of the problems you're facing are indirectly related to this!

We've already got some open bugs relating to EventTableViewer:
260: Programmatic Selection and EventTableViewer
   https://glazedlists.dev.java.net/issues/show_bug.cgi?id=260
249: SWT VirtualTableHandler throws IndexOutOfBoundsException
   https://glazedlists.dev.java.net/issues/show_bug.cgi?id=249

In the interim, I recommend you avoid using VIRTUAL with your SWT tables.
We should have a fix soon that makes this all work again.

Cheers,
Jesse


On 9/9/05, Andres Olarte <[hidden email]> wrote:
I'm getting IndexOutOfBoundsExceptions when an user scrolls down to
the bottom on a SWT Virtual Table.  Here's a brief example:

import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.gui.TableFormat ;
import ca.odell.glazedlists.swt.EventTableViewer;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;


public class TestTable {

    public static void main(String[] args) {
       new TestTable().run();
   }

   public void run() {
       Display display = new Display();
       Shell shell = new Shell(display);
       shell.setLayout(new FillLayout());
       Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
       table.setHeaderVisible(true);
       BasicEventList basicList = new BasicEventList();
       for (int i = 0; i < 1000; i++) {
           basicList.add("Item " + i);
       }
       TableFormat tf = new TableFormat() {
           public String getColumnName(int i) {
               return "Colname";
           }

           public Object getColumnValue(Object o, int i) {
               return (String) o;
           }

           public int getColumnCount() {
               return 1;
           }
       };
       EventTableViewer virtualTableViewer = new EventTableViewer(basicList,
               table, tf);
       shell.open();
       while (!shell.isDisposed()) {
           if (!display.readAndDispatch()) {
               display.sleep();
           }
       }
       display.dispose();
   }

}


If you run this example, and the scroll to the bottom, you will get
the Exception.  It seems that the EventTableViewer is not setting the
correct size of the virtual table.  If you remove the SWT.VIRTUAL
flag, you don't get the exception.  I read some mails on other cases
where people where getting this exception, but it was due to other
factors that I don't think relate to this issue.  Any ideas?

Thanks,

Andres

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

olarte.andres
Not using SWT.VIRTUAL isn't an option really,  but thanks for the pointer
Is there any work already done to use JFace?  Any place to start to try to help?

Thanks,

Andres

On 9/9/05, Jesse Wilson <[hidden email]> wrote:

>
>  Hey Andres ---
>  
>  Thanks for the heads up on this. We've had numerous problems
>  with support for virtual table under SWT. Fortunately this should
>  all become simplified as we intend to change our implementation
>  so that it depends upon JFace's table viewer to do the actual
>  populating of the table.
>  
>  SWT's virtual table has caused us huge amounts of grief mostly
>  due to the toolkit's handing of selection, and I imagine that a lot
>  of the problems you're facing are indirectly related to this!
>  
>  We've already got some open bugs relating to EventTableViewer:
>  260: Programmatic Selection and EventTableViewer
>    
> https://glazedlists.dev.java.net/issues/show_bug.cgi?id=260
>  249: SWT VirtualTableHandler throws IndexOutOfBoundsException
>    
> https://glazedlists.dev.java.net/issues/show_bug.cgi?id=249
>  
>  In the interim, I recommend you avoid using VIRTUAL with your SWT tables.
>  We should have a fix soon that makes this all work again.
>  
>  Cheers,
>  Jesse
>  
>
>
> On 9/9/05, Andres Olarte <[hidden email]> wrote:
> >
> > I'm getting IndexOutOfBoundsExceptions when an user scrolls down to
> > the bottom on a SWT Virtual Table.  Here's a brief example:
> >
> > import ca.odell.glazedlists.BasicEventList;
> > import ca.odell.glazedlists.gui.TableFormat ;
> > import ca.odell.glazedlists.swt.EventTableViewer;
> >
> > import org.eclipse.swt.SWT;
> > import org.eclipse.swt.layout.FillLayout;
> > import org.eclipse.swt.widgets.Display;
> > import org.eclipse.swt.widgets.Shell;
> > import org.eclipse.swt.widgets.Table;
> >
> >
> > public class TestTable {
> >
> >     public static void main(String[] args) {
> >        new TestTable().run();
> >    }
> >
> >    public void run() {
> >        Display display = new Display();
> >        Shell shell = new Shell(display);
> >        shell.setLayout(new FillLayout());
> >        Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
> >        table.setHeaderVisible(true);
> >        BasicEventList basicList = new BasicEventList();
> >        for (int i = 0; i < 1000; i++) {
> >            basicList.add("Item " + i);
> >        }
> >        TableFormat tf = new TableFormat() {
> >            public String getColumnName(int i) {
> >                return "Colname";
> >            }
> >
> >            public Object getColumnValue(Object o, int i) {
> >                return (String) o;
> >            }
> >
> >            public int getColumnCount() {
> >                return 1;
> >            }
> >        };
> >        EventTableViewer virtualTableViewer = new
> EventTableViewer(basicList,
> >                table, tf);
> >        shell.open();
> >        while (!shell.isDisposed()) {
> >            if (!display.readAndDispatch()) {
> >                display.sleep();
> >            }
> >        }
> >        display.dispose();
> >    }
> >
> > }
> >
> >
> > If you run this example, and the scroll to the bottom, you will get
> > the Exception.  It seems that the EventTableViewer is not setting the
> > correct size of the virtual table.  If you remove the SWT.VIRTUAL
> > flag, you don't get the exception.  I read some mails on other cases
> > where people where getting this exception, but it was due to other
> > factors that I don't think relate to this issue.  Any ideas?
> >
> > Thanks,
> >
> > Andres
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [hidden email]
> > For additional commands, e-mail:
> [hidden email]
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

olarte.andres
I've been playing around with glazed lists' source code, and bug 249
seems to be a problem in Barcode.  I haven't been able to pin point
it, but I've made a simple workaround in the handleDetail method of
the VirtualTableHandler inner class:

  int index = requested.getIndex(whiteIndex, Barcode.WHITE);
           
            //Check to see if we're out of bounds.
            if (index>=swtSource.size()) {
                index=table.getTopIndex();
            }

This has been enough to prevent the OutOfBoundsException.  I'm quite
sure this isn't a proper fix, but I'm still trying to understand how
Barcode works.

On 9/9/05, Andres Olarte <[hidden email]> wrote:

> Not using SWT.VIRTUAL isn't an option really,  but thanks for the pointer
> Is there any work already done to use JFace?  Any place to start to try to help?
>
> Thanks,
>
> Andres
>
> On 9/9/05, Jesse Wilson <[hidden email]> wrote:
> >
> >  Hey Andres ---
> >
> >  Thanks for the heads up on this. We've had numerous problems
> >  with support for virtual table under SWT. Fortunately this should
> >  all become simplified as we intend to change our implementation
> >  so that it depends upon JFace's table viewer to do the actual
> >  populating of the table.
> >
> >  SWT's virtual table has caused us huge amounts of grief mostly
> >  due to the toolkit's handing of selection, and I imagine that a lot
> >  of the problems you're facing are indirectly related to this!
> >
> >  We've already got some open bugs relating to EventTableViewer:
> >  260: Programmatic Selection and EventTableViewer
> >
> > https://glazedlists.dev.java.net/issues/show_bug.cgi?id=260
> >  249: SWT VirtualTableHandler throws IndexOutOfBoundsException
> >
> > https://glazedlists.dev.java.net/issues/show_bug.cgi?id=249
> >
> >  In the interim, I recommend you avoid using VIRTUAL with your SWT tables.
> >  We should have a fix soon that makes this all work again.
> >
> >  Cheers,
> >  Jesse
> >
> >
> >
> > On 9/9/05, Andres Olarte <[hidden email]> wrote:
> > >
> > > I'm getting IndexOutOfBoundsExceptions when an user scrolls down to
> > > the bottom on a SWT Virtual Table.  Here's a brief example:
> > >
> > > import ca.odell.glazedlists.BasicEventList;
> > > import ca.odell.glazedlists.gui.TableFormat ;
> > > import ca.odell.glazedlists.swt.EventTableViewer;
> > >
> > > import org.eclipse.swt.SWT;
> > > import org.eclipse.swt.layout.FillLayout;
> > > import org.eclipse.swt.widgets.Display;
> > > import org.eclipse.swt.widgets.Shell;
> > > import org.eclipse.swt.widgets.Table;
> > >
> > >
> > > public class TestTable {
> > >
> > >     public static void main(String[] args) {
> > >        new TestTable().run();
> > >    }
> > >
> > >    public void run() {
> > >        Display display = new Display();
> > >        Shell shell = new Shell(display);
> > >        shell.setLayout(new FillLayout());
> > >        Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
> > >        table.setHeaderVisible(true);
> > >        BasicEventList basicList = new BasicEventList();
> > >        for (int i = 0; i < 1000; i++) {
> > >            basicList.add("Item " + i);
> > >        }
> > >        TableFormat tf = new TableFormat() {
> > >            public String getColumnName(int i) {
> > >                return "Colname";
> > >            }
> > >
> > >            public Object getColumnValue(Object o, int i) {
> > >                return (String) o;
> > >            }
> > >
> > >            public int getColumnCount() {
> > >                return 1;
> > >            }
> > >        };
> > >        EventTableViewer virtualTableViewer = new
> > EventTableViewer(basicList,
> > >                table, tf);
> > >        shell.open();
> > >        while (!shell.isDisposed()) {
> > >            if (!display.readAndDispatch()) {
> > >                display.sleep();
> > >            }
> > >        }
> > >        display.dispose();
> > >    }
> > >
> > > }
> > >
> > >
> > > If you run this example, and the scroll to the bottom, you will get
> > > the Exception.  It seems that the EventTableViewer is not setting the
> > > correct size of the virtual table.  If you remove the SWT.VIRTUAL
> > > flag, you don't get the exception.  I read some mails on other cases
> > > where people where getting this exception, but it was due to other
> > > factors that I don't think relate to this issue.  Any ideas?
> > >
> > > Thanks,
> > >
> > > Andres
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [hidden email]
> > > For additional commands, e-mail:
> > [hidden email]
> > >
> > >
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: IndexOutOfBoundsExceptions on SWT Virtual Tables

Kevin Maltby
Hey Andres,

I'm on the trail of this bug....I know exactly what's causing it, but my
fix uncovered a separate but related problem that I'm going to tackle
before I check in the fix.

Thanks for the sample code and valuable debug info in your bug
reporting.  They pointed me exactly where I needed to look.  (It also
helps that I wrote both the swt EventTableViewer and the Barcode).
Should be resolved tonight or tomorrow by mid afternoon EST....roughly.

Cheers,
Kevin

-----Original Message-----
From: Andres Olarte [mailto:[hidden email]]
Sent: Monday, September 12, 2005 2:17 PM
To: [hidden email]
Subject: Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

I've been playing around with glazed lists' source code, and bug 249
seems to be a problem in Barcode.  I haven't been able to pin point
it, but I've made a simple workaround in the handleDetail method of
the VirtualTableHandler inner class:

  int index = requested.getIndex(whiteIndex, Barcode.WHITE);
           
            //Check to see if we're out of bounds.
            if (index>=swtSource.size()) {
                index=table.getTopIndex();
            }

This has been enough to prevent the OutOfBoundsException.  I'm quite
sure this isn't a proper fix, but I'm still trying to understand how
Barcode works.

On 9/9/05, Andres Olarte <[hidden email]> wrote:
> Not using SWT.VIRTUAL isn't an option really,  but thanks for the
pointer
> Is there any work already done to use JFace?  Any place to start to
try to help?

>
> Thanks,
>
> Andres
>
> On 9/9/05, Jesse Wilson <[hidden email]> wrote:
> >
> >  Hey Andres ---
> >
> >  Thanks for the heads up on this. We've had numerous problems
> >  with support for virtual table under SWT. Fortunately this should
> >  all become simplified as we intend to change our implementation
> >  so that it depends upon JFace's table viewer to do the actual
> >  populating of the table.
> >
> >  SWT's virtual table has caused us huge amounts of grief mostly
> >  due to the toolkit's handing of selection, and I imagine that a lot
> >  of the problems you're facing are indirectly related to this!
> >
> >  We've already got some open bugs relating to EventTableViewer:
> >  260: Programmatic Selection and EventTableViewer
> >
> > https://glazedlists.dev.java.net/issues/show_bug.cgi?id=260
> >  249: SWT VirtualTableHandler throws IndexOutOfBoundsException
> >
> > https://glazedlists.dev.java.net/issues/show_bug.cgi?id=249
> >
> >  In the interim, I recommend you avoid using VIRTUAL with your SWT
tables.

> >  We should have a fix soon that makes this all work again.
> >
> >  Cheers,
> >  Jesse
> >
> >
> >
> > On 9/9/05, Andres Olarte <[hidden email]> wrote:
> > >
> > > I'm getting IndexOutOfBoundsExceptions when an user scrolls down
to

> > > the bottom on a SWT Virtual Table.  Here's a brief example:
> > >
> > > import ca.odell.glazedlists.BasicEventList;
> > > import ca.odell.glazedlists.gui.TableFormat ;
> > > import ca.odell.glazedlists.swt.EventTableViewer;
> > >
> > > import org.eclipse.swt.SWT;
> > > import org.eclipse.swt.layout.FillLayout;
> > > import org.eclipse.swt.widgets.Display;
> > > import org.eclipse.swt.widgets.Shell;
> > > import org.eclipse.swt.widgets.Table;
> > >
> > >
> > > public class TestTable {
> > >
> > >     public static void main(String[] args) {
> > >        new TestTable().run();
> > >    }
> > >
> > >    public void run() {
> > >        Display display = new Display();
> > >        Shell shell = new Shell(display);
> > >        shell.setLayout(new FillLayout());
> > >        Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
> > >        table.setHeaderVisible(true);
> > >        BasicEventList basicList = new BasicEventList();
> > >        for (int i = 0; i < 1000; i++) {
> > >            basicList.add("Item " + i);
> > >        }
> > >        TableFormat tf = new TableFormat() {
> > >            public String getColumnName(int i) {
> > >                return "Colname";
> > >            }
> > >
> > >            public Object getColumnValue(Object o, int i) {
> > >                return (String) o;
> > >            }
> > >
> > >            public int getColumnCount() {
> > >                return 1;
> > >            }
> > >        };
> > >        EventTableViewer virtualTableViewer = new
> > EventTableViewer(basicList,
> > >                table, tf);
> > >        shell.open();
> > >        while (!shell.isDisposed()) {
> > >            if (!display.readAndDispatch()) {
> > >                display.sleep();
> > >            }
> > >        }
> > >        display.dispose();
> > >    }
> > >
> > > }
> > >
> > >
> > > If you run this example, and the scroll to the bottom, you will
get
> > > the Exception.  It seems that the EventTableViewer is not setting
the
> > > correct size of the virtual table.  If you remove the SWT.VIRTUAL
> > > flag, you don't get the exception.  I read some mails on other
cases
> > > where people where getting this exception, but it was due to other
> > > factors that I don't think relate to this issue.  Any ideas?
> > >
> > > Thanks,
> > >
> > > Andres
> > >
> > >
> >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [hidden email]
> > > For additional commands, e-mail:
> > [hidden email]
> > >
> > >
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

olarte.andres
I will be very insterested in looking over how you fixed the code.
I'm glad if I was of any help. But most of all thanks for such a nice
piece of code

Best regards,

Andres

On 9/12/05, Kevin Maltby <[hidden email]> wrote:

> Hey Andres,
>
> I'm on the trail of this bug....I know exactly what's causing it, but my
> fix uncovered a separate but related problem that I'm going to tackle
> before I check in the fix.
>
> Thanks for the sample code and valuable debug info in your bug
> reporting.  They pointed me exactly where I needed to look.  (It also
> helps that I wrote both the swt EventTableViewer and the Barcode).
> Should be resolved tonight or tomorrow by mid afternoon EST....roughly.
>
> Cheers,
> Kevin
>
> -----Original Message-----
> From: Andres Olarte [mailto:[hidden email]]
> Sent: Monday, September 12, 2005 2:17 PM
> To: [hidden email]
> Subject: Re: IndexOutOfBoundsExceptions on SWT Virtual Tables
>
> I've been playing around with glazed lists' source code, and bug 249
> seems to be a problem in Barcode.  I haven't been able to pin point
> it, but I've made a simple workaround in the handleDetail method of
> the VirtualTableHandler inner class:
>
>   int index = requested.getIndex(whiteIndex, Barcode.WHITE);
>
>             //Check to see if we're out of bounds.
>             if (index>=swtSource.size()) {
>                 index=table.getTopIndex();
>             }
>
> This has been enough to prevent the OutOfBoundsException.  I'm quite
> sure this isn't a proper fix, but I'm still trying to understand how
> Barcode works.
>
> On 9/9/05, Andres Olarte <[hidden email]> wrote:
> > Not using SWT.VIRTUAL isn't an option really,  but thanks for the
> pointer
> > Is there any work already done to use JFace?  Any place to start to
> try to help?
> >
> > Thanks,
> >
> > Andres
> >
> > On 9/9/05, Jesse Wilson <[hidden email]> wrote:
> > >
> > >  Hey Andres ---
> > >
> > >  Thanks for the heads up on this. We've had numerous problems
> > >  with support for virtual table under SWT. Fortunately this should
> > >  all become simplified as we intend to change our implementation
> > >  so that it depends upon JFace's table viewer to do the actual
> > >  populating of the table.
> > >
> > >  SWT's virtual table has caused us huge amounts of grief mostly
> > >  due to the toolkit's handing of selection, and I imagine that a lot
> > >  of the problems you're facing are indirectly related to this!
> > >
> > >  We've already got some open bugs relating to EventTableViewer:
> > >  260: Programmatic Selection and EventTableViewer
> > >
> > > https://glazedlists.dev.java.net/issues/show_bug.cgi?id=260
> > >  249: SWT VirtualTableHandler throws IndexOutOfBoundsException
> > >
> > > https://glazedlists.dev.java.net/issues/show_bug.cgi?id=249
> > >
> > >  In the interim, I recommend you avoid using VIRTUAL with your SWT
> tables.
> > >  We should have a fix soon that makes this all work again.
> > >
> > >  Cheers,
> > >  Jesse
> > >
> > >
> > >
> > > On 9/9/05, Andres Olarte <[hidden email]> wrote:
> > > >
> > > > I'm getting IndexOutOfBoundsExceptions when an user scrolls down
> to
> > > > the bottom on a SWT Virtual Table.  Here's a brief example:
> > > >
> > > > import ca.odell.glazedlists.BasicEventList;
> > > > import ca.odell.glazedlists.gui.TableFormat ;
> > > > import ca.odell.glazedlists.swt.EventTableViewer;
> > > >
> > > > import org.eclipse.swt.SWT;
> > > > import org.eclipse.swt.layout.FillLayout;
> > > > import org.eclipse.swt.widgets.Display;
> > > > import org.eclipse.swt.widgets.Shell;
> > > > import org.eclipse.swt.widgets.Table;
> > > >
> > > >
> > > > public class TestTable {
> > > >
> > > >     public static void main(String[] args) {
> > > >        new TestTable().run();
> > > >    }
> > > >
> > > >    public void run() {
> > > >        Display display = new Display();
> > > >        Shell shell = new Shell(display);
> > > >        shell.setLayout(new FillLayout());
> > > >        Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
> > > >        table.setHeaderVisible(true);
> > > >        BasicEventList basicList = new BasicEventList();
> > > >        for (int i = 0; i < 1000; i++) {
> > > >            basicList.add("Item " + i);
> > > >        }
> > > >        TableFormat tf = new TableFormat() {
> > > >            public String getColumnName(int i) {
> > > >                return "Colname";
> > > >            }
> > > >
> > > >            public Object getColumnValue(Object o, int i) {
> > > >                return (String) o;
> > > >            }
> > > >
> > > >            public int getColumnCount() {
> > > >                return 1;
> > > >            }
> > > >        };
> > > >        EventTableViewer virtualTableViewer = new
> > > EventTableViewer(basicList,
> > > >                table, tf);
> > > >        shell.open();
> > > >        while (!shell.isDisposed()) {
> > > >            if (!display.readAndDispatch()) {
> > > >                display.sleep();
> > > >            }
> > > >        }
> > > >        display.dispose();
> > > >    }
> > > >
> > > > }
> > > >
> > > >
> > > > If you run this example, and the scroll to the bottom, you will
> get
> > > > the Exception.  It seems that the EventTableViewer is not setting
> the
> > > > correct size of the virtual table.  If you remove the SWT.VIRTUAL
> > > > flag, you don't get the exception.  I read some mails on other
> cases
> > > > where people where getting this exception, but it was due to other
> > > > factors that I don't think relate to this issue.  Any ideas?
> > > >
> > > > Thanks,
> > > >
> > > > Andres
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > [hidden email]
> > > > For additional commands, e-mail:
> > > [hidden email]
> > > >
> > > >
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: IndexOutOfBoundsExceptions on SWT Virtual Tables

Kevin Maltby
Hey Andres,

The fix is in CVS now, and I've jar'd it up for your convenience.  The
latest is available as glazedlists.jar here:

https://glazedlists.dev.java.net/servlets/ProjectDocumentList?folderID=3
916

There were two problems.  The first was an issue in a method in Barcode
that up until the swt EventTableViewer was massively overhauled two
months ago hadn't received any exercise outside of our unit tests.  The
method in question was getWhiteIndex(int index, boolean left).  When the
barcode contained black elements and this method was called on an index
that was in the "trailing whitespace" it returned an incorrect value.
That was the first problem.

The second was with how the internal virtual item state was being
maintained.  In certain situations, caused primarily by filtering, it
would fall out of state and IndexOutOfBoundsExceptions would be thrown.
That's been resolved by changing how it updates the internal state.

I'm going to have to look into the selection stuff to see if I can
figure out why it's failing.  But this fix should help.  Happy glazing
and let me know if you have any more problems.

Cheers,
Kevin

-----Original Message-----
From: Andres Olarte [mailto:[hidden email]]
Sent: Monday, September 12, 2005 9:27 PM
To: [hidden email]
Subject: Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

I will be very insterested in looking over how you fixed the code.
I'm glad if I was of any help. But most of all thanks for such a nice
piece of code

Best regards,

Andres


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IndexOutOfBoundsExceptions on SWT Virtual Tables

olarte.andres
Works great, great job !

No more OutOfBoundsExceptions, and filtering now works correctly.  

(I didn't use the prebuilt version, I compiled the code from CVS)

On 9/13/05, Kevin Maltby <[hidden email]> wrote:

> Hey Andres,
>
> The fix is in CVS now, and I've jar'd it up for your convenience.  The
> latest is available as glazedlists.jar here:
>
> https://glazedlists.dev.java.net/servlets/ProjectDocumentList?folderID=3
> 916
>
> There were two problems.  The first was an issue in a method in Barcode
> that up until the swt EventTableViewer was massively overhauled two
> months ago hadn't received any exercise outside of our unit tests.  The
> method in question was getWhiteIndex(int index, boolean left).  When the
> barcode contained black elements and this method was called on an index
> that was in the "trailing whitespace" it returned an incorrect value.
> That was the first problem.
>
> The second was with how the internal virtual item state was being
> maintained.  In certain situations, caused primarily by filtering, it
> would fall out of state and IndexOutOfBoundsExceptions would be thrown.
> That's been resolved by changing how it updates the internal state.
>
> I'm going to have to look into the selection stuff to see if I can
> figure out why it's failing.  But this fix should help.  Happy glazing
> and let me know if you have any more problems.
>
> Cheers,
> Kevin
>
> -----Original Message-----
> From: Andres Olarte [mailto:[hidden email]]
> Sent: Monday, September 12, 2005 9:27 PM
> To: [hidden email]
> Subject: Re: IndexOutOfBoundsExceptions on SWT Virtual Tables
>
> I will be very insterested in looking over how you fixed the code.
> I'm glad if I was of any help. But most of all thanks for such a nice
> piece of code
>
> Best regards,
>
> Andres
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]