在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();
}
}发布于 2013-02-15 00:28:43
我希望启动画面会在一切初始化后关闭,而不是在设定的秒数后关闭。否则你甚至不需要一个。
根据this thread的说法,您应该确保在正确的上下文中调用Platform.endSplash()方法,即start(IApplicationContext context)方法
如果您已经这样做了,请提供一些代码来帮助我们了解您的问题
发布于 2013-02-17 22:37:33
启动画面的关闭由Workbench中创建的StartupMonitor处理。
工作台部件创建后(如您所说,“只要某些UI显示”),它将遍历所有已注册的启动服务。事实上,您的工作台是可见的,并且必须等待大约5-6分钟(或秒)才能关闭启动屏幕,这意味着您有另一个启动监视器阻止您进行所需的UI转换。
https://stackoverflow.com/questions/14877003
复制相似问题