Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Empty Virtual Nebula Grid throws exception
Empty Virtual Nebula Grid throws exception [message #1730833] Thu, 28 April 2016 22:42 Go to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
When a Grid control has no items and is created a virtual, an exception is thrown

Here's a cut down version of the Grid Example that reproduces the problem:
public class NebulaGridExamplePage implements IExamplePage {

	public void createControl(Composite parent) {
		parent.setLayout(ExampleUtil.createGridLayout(1, true, true, true));
		ExampleUtil.createHeading(parent, "Profit and Loss Balance Sheet", 1);
		parent.setLayoutData(ExampleUtil.createFillData());
		Grid grid = createGrid(parent);
		GridColumn column = new GridColumn(grid, SWT.LEFT);
		column.setWidth(100);
	}

	private Grid createGrid(Composite parent) {
		Grid grid = new Grid(parent, SWT.V_SCROLL | SWT.BORDER | SWT.VIRTUAL);
		GridData tableLayoutData = ExampleUtil.createFillData();
		tableLayoutData.verticalIndent = 10;
		grid.setLayoutData(tableLayoutData);
		return grid;
	}
}


The exception thrown:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.get(ArrayList.java:429)
	at org.eclipse.nebula.widgets.grid.Grid.doRedraw(Grid.java:2492)
	at org.eclipse.nebula.widgets.grid.Grid.access$8(Grid.java:2489)
	at org.eclipse.nebula.widgets.grid.Grid$GridAdapter.doRedraw(Grid.java:3181)
	at org.eclipse.nebula.widgets.grid.internal.gridkit.GridLCA.doRedrawFake(GridLCA.java:163)
	at org.eclipse.swt.widgets.Display.executeNextRedraw(Display.java:1332)
	at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1204)
	at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173)
	at org.eclipse.rap.rwt.application.AbstractEntryPoint.createUI(AbstractEntryPoint.java:69)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:290)
	at java.lang.Thread.run(Thread.java:745)
	at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:107)


Non-virtual grids work fine. Should I raise this in bugzilla?

[Updated on: Thu, 28 April 2016 22:53]

Report message to a moderator

Re: Empty Virtual Nebula Grid throws exception [message #1730845 is a reply to message #1730833] Fri, 29 April 2016 08:03 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
yes, please open a bugzilla.
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Wrong context path since 3.0 or 3.1
Next Topic:refresh page
Goto Forum:
  


Current Time: Fri Apr 26 09:12:17 GMT 2024

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

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

Back to the top