【问题标题】:How do I close the splash screen in an eclipse RCP application?如何关闭 Eclipse RCP 应用程序中的启动画面?
【发布时间】:2013-02-14 14:27:29
【问题描述】:

在 Eclipse RCP 应用程序中,splash.bmp 用作启动画面。它在应用程序运行大约 5-6 分钟后关闭。我希望它在某些 UI 显示后立即关闭。我尝试在PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()) 之前使用应用程序上下文的Platform.endSplash()applicationRunning()

无法关闭启动画面。

任何建议都会有所帮助。如果我可以在大约 10 -15 秒后关闭启动画面也可以。

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();
        }
}

【问题讨论】:

  • 我以前从未遇到过这种情况。在我所有的 RCP 应用程序中,splash.bmp 会在应用程序启动后立即关闭。您使用的是什么版本的 Eclipse?
  • 版本:Indigo Service Release 2 Build id:20120216-1857

标签: eclipse splash-screen rcp


【解决方案1】:

我希望启动画面在所有内容都初始化后关闭,而不是在设定的几秒钟后关闭。否则你甚至不需要一个。

根据this thread,你应该确保在正确的上下文中调用Platform.endSplash()方法,即start(IApplicationContext context)方法

如果您已经这样做了,请提供一些代码来帮助我们理解您的问题

【讨论】:

    【解决方案2】:

    启动画面的关闭由Workbench中创建的StartupMonitor处理。

    创建工作台部件后(如您所说,“一旦显示某些 UI”),它将循环通过所有已注册的启动服务。您的工作台可见并且必须等待大约 5-6 分钟(或几秒钟)才能关闭初始屏幕,这意味着您有另一个启动监视器阻止了所需的 UI 转换。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-09
      • 2019-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-17
      相关资源
      最近更新 更多