Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Click on column header (select) gives an NullPointerException(Click on column header (select) gives an NullPointerException)
Click on column header (select) gives an NullPointerException [message #947799] Wed, 17 October 2012 12:56 Go to next message
Renso Lohuis is currently offline Renso LohuisFriend
Messages: 44
Registered: July 2012
Member
I have a NatTable with a Body layer stack similar to full featured example (including a SelectionLayer).

I removed the:
		natTable.addConfiguration(new SingleClickSortConfiguration());

so the action for clicking a column header is selecting the column. So far so good.

But when the table is empty I get the following null pointer exception:

java.lang.NullPointerException
	at org.eclipse.nebula.widgets.nattable.selection.SelectCellCommandHandler.selectCell(SelectCellCommandHandler.java:67)
	at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.selectCell(SelectionLayer.java:214)
	at org.eclipse.nebula.widgets.nattable.selection.SelectColumnCommandHandler.selectColumn(SelectColumnCommandHandler.java:44)
	at org.eclipse.nebula.widgets.nattable.selection.SelectColumnCommandHandler.doCommand(SelectColumnCommandHandler.java:35)
	at org.eclipse.nebula.widgets.nattable.selection.SelectColumnCommandHandler.doCommand(SelectColumnCommandHandler.java:1)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.doCommand(AbstractLayer.java:152)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:102)
	at org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.doCommand(SelectionLayer.java:429)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:107)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.doCommand(ViewportLayer.java:643)
	at org.eclipse.nebula.widgets.nattable.viewport.command.ViewportSelectColumnCommandHandler.doCommand(ViewportSelectColumnCommandHandler.java:33)
	at org.eclipse.nebula.widgets.nattable.viewport.command.ViewportSelectColumnCommandHandler.doCommand(ViewportSelectColumnCommandHandler.java:1)
	at org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler.doCommand(AbstractLayerCommandHandler.java:19)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayer.doCommand(AbstractLayer.java:152)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:102)
	at org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer.doCommand(ViewportLayer.java:643)
	at org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform.doCommand(AbstractLayerTransform.java:107)
	at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommandOnChildLayer(GridLayer.java:107)
	at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommandOnChildLayers(GridLayer.java:94)
	at org.eclipse.nebula.widgets.nattable.layer.CompositeLayer.doCommand(CompositeLayer.java:140)
	at org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer.doCommand(GridLayer.java:169)
	at org.eclipse.nebula.widgets.nattable.NatTable.doCommand(NatTable.java:507)
	at org.eclipse.nebula.widgets.nattable.viewport.action.ViewportSelectColumnAction.run(ViewportSelectColumnAction.java:33)
	at org.eclipse.nebula.widgets.nattable.ui.mode.MouseModeEventHandler.executeSingleClickAction(MouseModeEventHandler.java:118)
	at org.eclipse.nebula.widgets.nattable.ui.mode.MouseModeEventHandler.mouseUp(MouseModeEventHandler.java:69)
	at org.eclipse.nebula.widgets.nattable.ui.mode.ModeSupport.mouseUp(ModeSupport.java:99)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
	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.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at nl.test.NewTestHandler.execute(NewTestHandler.java:33)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:851)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:744)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:728)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:667)
	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)

How can I solve this?
Re: Click on column header (select) gives an NullPointerException [message #947805 is a reply to message #947799] Wed, 17 October 2012 13:03 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
This is a bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=391732

The only way to solve this is to download the current head and build the NatTable yourself. Or of course don't show an empty table. Wink
Previous Topic:auto-resizing the column header
Next Topic:EventList.removeAll throws IndexOutOfBoundsException
Goto Forum:
  


Current Time: Thu Mar 28 16:41:04 GMT 2024

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

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

Back to the top