Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Nullpointer Exception when clicking outside of table
Nullpointer Exception when clicking outside of table [message #1065712] Thu, 27 June 2013 08:47 Go to next message
Aljoscha Steffens is currently offline Aljoscha Steffens
Messages: 302
Registered: November 2012
Senior Member
Hi,
I get a NullPointerException when I click outside of the table (in the darkgrey area).

Here is the simple version of the code:
		dataProvider = new DataProvider();
		
		final ViewportLayer layer = new ViewportLayer( new DataLayer(dataProvider) );
		layer.setRegionName(GridRegion.BODY);
		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
		natTable = new NatTable(container, layer, false);
		natTable.setLayoutData(gd);
		natTable.addConfiguration(new DefaultEditBindings());
		natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
		natTable.configure();


It appears to have sth to do with
layer.setRegionName(GridRegion.BODY);

and
natTable.addConfiguration(new DefaultEditBindings());
.
If I delete either of those lines in the complete code, I don't get an error, but of course my table does not work as desired (I can't edit cells).


Here the errormessage:
java.lang.NullPointerException
!SESSION 2013-06-27 10:28:24.382 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product MEXA.product
Command-line arguments:  -product MEXA.product -data E:\eclipse42\Workspace/../runtime-MEXA.product -dev file:E:/eclipse42/Workspace/.metadata/.plugins/org.eclipse.pde.core/MEXA.product/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-06-27 10:28:29.608
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException
	at org.eclipse.nebula.widgets.nattable.ui.matcher.BodyCellEditorMouseEventMatcher.matches(BodyCellEditorMouseEventMatcher.java:42)
	at org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry.getDragMode(UiBindingRegistry.java:57)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ConfigurableModeEventHandler.mouseDown(ConfigurableModeEventHandler.java:56)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ModeSupport.mouseDown(ModeSupport.java:95)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:192)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
	at org.eclipse.nebula.widgets.nattable.ui.matcher.BodyCellEditorMouseEventMatcher.matches(BodyCellEditorMouseEventMatcher.java:42)
	at org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry.getMouseEventAction(UiBindingRegistry.java:96)
	at org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry.getSingleClickAction(UiBindingRegistry.java:74)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ConfigurableModeEventHandler.mouseDown(ConfigurableModeEventHandler.java:54)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ModeSupport.mouseDown(ModeSupport.java:95)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:192)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)



What can I do? Smile
Re: Nullpointer Exception when clicking outside of table [message #1065716 is a reply to message #1065712] Thu, 27 June 2013 08:56 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1347
Registered: July 2012
Senior Member
Quote:
What can I do? Smile


Switch to NatTable 1.0.0 as this bug was fixed there.

Quote from New & Noteworthy
Quote:
Deprecation of BodyCellEditorMouseEventMatcher which needed to be registered in the edit bindings for every ICellEditor implementation and replaced it with a more general CellEditorMouseEventMatcher. Doing this allows to add new ICellEditors more easily without needing to modify the edit bindings everytime
Re: Nullpointer Exception when clicking outside of table [message #1065725 is a reply to message #1065716] Thu, 27 June 2013 09:37 Go to previous message
Aljoscha Steffens is currently offline Aljoscha Steffens
Messages: 302
Registered: November 2012
Senior Member
Ah didn't know you released 1.0 yet. Good job!! Smile
Works fine now, thanks a lot
Previous Topic:Selection not working with disabled sorting
Next Topic:How to add own CellPainters and Editors to the FilterRowHeaderComposite?
Goto Forum:
  


Current Time: Thu Oct 30 12:16:08 GMT 2014

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

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