I have a pure e4-application with a Thread that checks the active session in the Background. When this check fails
EPartService.getDirtyParts()
is called.
When this happens while the application is not on top, the call fails with the following StackTrace
java.lang.IllegalStateException: Application does not have an active window
at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.getActiveWindowService(ApplicationPartServiceImpl.java:36)
at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.getDirtyParts(ApplicationPartServiceImpl.java:123)
...
...
Calling the EPartService from the DisplayThread (Display.syncExec...) does not seem to make any difference.
Shouldn't we be able to use the EPartService while the application window is not the active one?
Sopot Cela Messages: 447 Registered: December 2010
Senior Member
I think this error happens when there is no active window at all in the application. At what point in the lifecycle does that happen? I doubt it is trying to be injected a bit early in the lifecycle.