Doan Linh
Doan Linh

Reputation: 107

RCP application is not restarted

I have my own IApplication and modify start() as:

@Override
    public Object start( IApplicationContext context )
    {
        LOGGER.debug( "Application.start(IApplicationContext context " + context + ")" );

        Display display = PlatformUI.createDisplay();
        try
        {
            int returnCode = PlatformUI.createAndRunWorkbench( display, new ApplicationWorkbenchAdvisor() );
            if (returnCode == PlatformUI.RETURN_RESTART)
            {
                return IApplication.EXIT_RESTART;
            }

            return IApplication.EXIT_OK;
        }
        finally
        {
            display.dispose();
        }
    }

and i call PlatformUI.getWorkbench().restart();in one of my handler for one of my button. It works fine when i run within Eclipse, but the app is just shutdown when I build as a java webstart.

I read this link and as my understanding is that it won't work if it isn't launched by eclipse.exe. However, I haven't found what is the final solution for it. Any idea?

Upvotes: 1

Views: 70

Answers (1)

greg-449
greg-449

Reputation: 111216

From the Eclipse help on using Java Web Start:

Known limitations

Request to exit the application with a restart code are ignored;

So this isn't currently possible.

Upvotes: 3

Related Questions