运行 UI 线程上的 Eclipse 插件激活器的 .start() 方法

Run Eclipse Plugin Activator's .start() Method on UI Thread

AbstractUIPlugin 的规范指出 startup 方法不能假定它是 UI 线程上的 运行。 start 方法也是如此吗?

start 方法不适合放置 UI 代码。除其他外,它通常不会被调用,直到你的插件中的一些其他代码 运行s.

Plugin 的 JavaDoc 定义了 start 说:

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 将 运行 打开。