Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Losing focus on DateCellEditor(Causing a NullPointerException on Linux)
Losing focus on DateCellEditor [message #1776420] Thu, 16 November 2017 10:41 Go to next message
Robin Welsch is currently offline Robin WelschFriend
Messages: 1
Registered: November 2017
Junior Member

Things have been working fine on Windows so far, but I'm having problems with the DateCellEditor component under Linux (with GNOME 3).
The calendar window never shows up when the user requests it. Instead, I'm having this NullPointerException :

	at org.eclipse.swt.widgets.DateTime.isDropped(
	at org.eclipse.swt.widgets.DateTime.dropDownCalendar(
	at org.eclipse.swt.widgets.DateTime$5.handleEvent(
	at org.eclipse.swt.widgets.EventTable.sendEvent(
	at org.eclipse.swt.widgets.Display.filterEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Display.runDeferredEvents(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(
	at org.eclipse.ui.internal.Workbench$
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(

Specifically, the popupShell field is null, but it shouldn't be at this point.
It seems it lost focus before even showing up. I've noticed the onDispose() method is called before the exception happens, here's the stack at the breakpoint when it's nullified:

Thread [main] (Suspended (breakpoint at line 539 in DateTime))	
	DateTime.onDispose(Event) line: 539	
	DateTime$3.handleEvent(Event) line: 453	
	EventTable.sendEvent(Event) line: 84	
	Display.sendEvent(EventTable, Event) line: 5227	
	DateTime(Widget).sendEvent(Event) line: 1340	
	DateTime(Widget).sendEvent(int, Event, boolean) line: 1366	
	DateTime(Widget).sendEvent(int) line: 1345	
	DateTime(Widget).release(boolean) line: 1153	
	DateTime(Control).release(boolean) line: 3996	
	DateTime(Widget).dispose() line: 479	
	DateCellEditor(AbstractCellEditor).close() line: 408	
	DateCellEditor(AbstractCellEditor).commit(SelectionLayer$MoveDirectionEnum, boolean, boolean) line: 369	
	DateCellEditor(AbstractCellEditor).commit(SelectionLayer$MoveDirectionEnum, boolean) line: 356	
	AbstractCellEditor$InlineFocusListener.focusLost(FocusEvent) line: 502	
	TypedListener.handleEvent(Event) line: 144	
	EventTable.sendEvent(Event) line: 84	
	Display.sendEvent(EventTable, Event) line: 5227	
	DateTime(Widget).sendEvent(Event) line: 1340	
	DateTime(Widget).sendEvent(int, Event, boolean) line: 1366	
	DateTime(Widget).sendEvent(int) line: 1345	
	DateTime(Control).sendFocusEvent(int) line: 4069	
	DateTime(Control).gtk_event_after(long, long) line: 3341	
	DateTime(Widget).windowProc(long, long, long) line: 1986	
	DateTime(Control).windowProc(long, long, long) line: 5827	
	Display.windowProc(long, long, long) line: 5498	
	OS._gtk_main_do_event(long) line: not available [native method]	
	OS.gtk_main_do_event(long) line: 9545	
	Display.eventProc(long, long) line: 1275	
	OS._g_main_context_iteration(long, boolean) line: not available [native method]	
	OS.g_main_context_iteration(long, boolean) line: 2495	
	Display.readAndDispatch() line: 4149	
	PartRenderingEngine$ line: 1121	
	Realm.runWithDefault(Realm, Runnable) line: 336, IEclipseContext) line: 1022	
	E4Workbench.createAndRunUI(MApplicationElement) line: 150	
	Workbench$ line: 693	
	Realm.runWithDefault(Realm, Runnable) line: 336	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 610	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 148

I don't know what to do here, it works properly on Windows so clearly there's a problem with a Linux-specific behavior, and my own code is never involved in this.

Re: Losing focus on DateCellEditor [message #1776499 is a reply to message #1776420] Fri, 17 November 2017 04:35 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2691
Registered: July 2012
Senior Member
The DateTime composite is not a very stable one in SWT. IIRC I have even created a ticket years ago because of null handling and rendering the text when it is focused without any response.

As the issue is not NatTable related you need to ask on the SWT forum. At least it looks like this.

Or use our Nebula Extension that contains the CDateTime editor which might behave better.
Previous Topic:Row header layer not converting position to index
Next Topic:Nattable does not display data when using SortHeaderLayer
Goto Forum:

Current Time: Wed Jun 19 11:06:39 GMT 2019

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

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

Back to the top