Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330661 - Add support for VIRTUAL mode
Summary: Add support for VIRTUAL mode
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mirko Paturzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-19 08:25 EST by Willy Michel CLA
Modified: 2021-07-05 11:39 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Willy Michel CLA 2010-11-19 08:25:11 EST
Build Identifier: I20100608-0911

It is possible to create the Grid with the VIRTUAL flag. But it will probably not be considered. As a result I get an OutOfMemoryError.

Reproducible: Always

Steps to Reproduce:
I prepared the GridSnippet1 code to reproduce this issue:

public class GridSnippet1
{
  public static void main( String[] args )
  {
    Display display = new Display();
    Shell shell = new Shell( display );
    shell.setLayout( new FillLayout() );

    Grid grid = new Grid( shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL );
    grid.setHeaderVisible( true );
    GridColumn column = new GridColumn( grid, SWT.NONE );
    column.setTree( true );
    column.setText( "Column 1" );
    column.setWidth( 100 );
    GridItem item1 = new GridItem( grid, SWT.NONE );
    item1.setText( "Root Item" );
    GridItem item2 = new GridItem( item1, SWT.NONE );
    item2.setText( "Second item" );
    GridItem item3 = new GridItem( item2, SWT.NONE );
    item3.setText( "Third Item" );

    grid.setItemCount( 1000000 );

    shell.setSize( 200, 200 );
    shell.open();
    while ( !shell.isDisposed() )
    {
      if ( !display.readAndDispatch() )
        display.sleep();
    }
    display.dispose();
  }
}
Comment 1 Mirko Paturzo CLA 2014-05-06 09:23:37 EDT
Patch https://bugs.eclipse.org/bugs/show_bug.cgi?id=385300 avoid OOM in creation phase.
Please see GridVirtualTableViewer.java snippet.