2013-02-14 69 views
0

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

无法关闭启动画面。

任何建议将有所帮助。如果我可以在大约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(); 
     } 
} 
+0

我从来没有遇到过这个。在我所有的RCP应用程序中,splash.bmp会在应用程序启动后立即关闭。你使用的是什么版本的Eclipse? – 2013-02-14 15:33:08

+0

版本:Indigo Service Release 2 内部编号:20120216-1857 – 2013-02-14 16:07:51

回答

0

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

this thread,你应该确保调用Platform.endSplash()方法在正确的范围内,这意味着该方法start(IApplicationContext context)

如果你已经做到这一点,请提供一些代码,以帮助我们理解您的问题

+0

我编辑了问题以添加代码。 – 2013-02-14 17:00:43

0

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

在创建工作台部件之后(就像您所说的,“只要有一个UI显示”),它将循环遍历所有已注册的启动服务。您的工作台可见且必须等待约5-6分钟(或几秒)才能启动屏幕关闭的事实意味着您有另一台启动监视器可以防止您想要的UI过渡。

相关问题