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
Hello,

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 :

java.lang.NullPointerException
	at org.eclipse.swt.widgets.DateTime.isDropped(DateTime.java:1026)
	at org.eclipse.swt.widgets.DateTime.dropDownCalendar(DateTime.java:550)
	at org.eclipse.swt.widgets.DateTime$5.handleEvent(DateTime.java:491)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1605)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1339)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4561)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4151)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)


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$4.run() line: 1121	
	Realm.runWithDefault(Realm, Runnable) line: 336	
	PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 1022	
	E4Workbench.createAndRunUI(MApplicationElement) line: 150	
	Workbench$5.run() 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.

Thanks.
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: 2624
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: Mon Nov 19 13:34:52 GMT 2018

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

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

Back to the top