Mahesh Acharya
Mahesh Acharya

Reputation: 11

How do I close the splash screen in an eclipse RCP application?

In an eclipse RCP application, a splash.bmp is used as the splash screen. It closes after about 5-6 minutes of the application being run. I want it to close as soon as some UI displays. I tried using Platform.endSplash() and also applicationRunning() of the application context just before PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()).

It fails to close the splash screen.

Any suggestions would be helpful. It would also be okay if I could close the splash screen after about 10 -15 seconds.

public Object start(IApplicationContext arg0) throws Exception {
        Display display = PlatformUI.createDisplay();
        int returnCode = 0;
        try {

            //arg0.applicationRunning();
            Platform.endSplash();
            returnCode = PlatformUI.createAndRunWorkbench(display,
                    new ApplicationWorkbenchAdvisor());

            if (returnCode == PlatformUI.RETURN_RESTART) {
                return PlatformUI.RETURN_RESTART;
            }

        return PlatformUI.RETURN_OK;
        } finally {
           //some other code here.
            display.dispose();
        }
}

Upvotes: 0

Views: 979

Answers (2)

jdknight
jdknight

Reputation: 1839

The closing of a splash screen is handled by the created StartupMonitor in Workbench.

After the workbench part is created (as you say, "as soon as some UI displays"), it will be cycling through all registered startup services. The fact that you have your workbench visible and have to wait ~5-6 minutes (or seconds) for your splash screen to close means you have another startup monitor preventing your desired UI transition.

Upvotes: 0

moeTi
moeTi

Reputation: 3904

I would expect the splash screen to close when everything is initialized, not after a set amount of seconds. Otherwise you don't even need one.

According to this thread, you should make sure to call the Platform.endSplash() method in the right context, meaning the method start(IApplicationContext context)

If you already do this, please provide some code to help us understand your problem

Upvotes: 0

Related Questions