Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Cannot create a part at APP_STARTUP_COMPLETE in Luna M6
Cannot create a part at APP_STARTUP_COMPLETE in Luna M6 [message #1333957] Mon, 05 May 2014 10:10
Alexander Levsha is currently offline Alexander LevshaFriend
Messages: 3
Registered: December 2013
Junior Member
Hi. I started migrating my app to Luna and encountered this issue.

The app may create Parts from PartDescriptors at startup and i subscribed to APP_STARTUP_COMPLETE event for that purpose. It worked fine in Kepler.
private void open(
        @Named("__DUMMY__") // workaround bug 378694
        final MApplication app,
        final EModelService model,
        final EPartService partService,
        UISynchronize sync
        ) {

    // ...
    sync.asyncExec(new Runnable() {
        public void run() {
            // ...
            MPart newPart = partService.createPart("descrId");
            ((MPartStack) model.find("stackId", app)).getChildren().add(newPart);
            partService.showPart(newPart, PartState.CREATE);

In Luna M6 though it throws an exception "Application does not have an active window"
!ENTRY org.eclipse.e4.ui.workbench 4 0 2014-05-05 14:02:57.065
!MESSAGE Internal Error
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Application does not have an active window)
	at org.eclipse.swt.SWT.error(
	at org.eclipse.swt.SWT.error(
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
	at org.eclipse.swt.widgets.Display.runAsyncMessages(
	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.e4.ui.internal.workbench.swt.E4Application.start(
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.eclipse.equinox.launcher.Main.invokeFramework(
	at org.eclipse.equinox.launcher.Main.basicRun(
	at org.eclipse.equinox.launcher.Main.main(
Caused by: java.lang.IllegalStateException: Application does not have an active window
	at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.getActiveWindowService(
	at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.createPart(
	at myapp.AddonOpen$
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
	... 20 more

Is this a bug or is my way of using this event incorrect?
Previous Topic:labels in Application.e4xmi are not resolved
Next Topic:Link a part to another part in "e4 way"
Goto Forum:

Current Time: Wed Oct 07 00:25:19 GMT 2015

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

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