2013-02-14 74 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過渡。

相關問題