AbstractUIPlugin的规范声明 startup
方法不能假设它在 UI 线程上运行。 start
方法也是如此吗?
最佳答案
start
方法不适合放置 UI 代码。除此之外,在插件中的其他代码运行之前,通常不会调用它。
定义 start
的 Plugin
的 JavaDoc 说:
This method and the stop(BundleContext) may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.
这并不能真正保证 start
将在哪个线程上运行。
关于java - 在 UI 线程上运行 Eclipse Plugin Activator 的 .start() 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31431546/