Eclipse rcp EclipseRCP-更新IStatusLineManager

Eclipse rcp EclipseRCP-更新IStatusLineManager,eclipse-rcp,workbench,Eclipse Rcp,Workbench,有人知道如何在应用程序工作台Windows Visor外部更新IStatusLineManager吗 我尝试了以下方法,但它抛出NullPointerException IStatusLineManager statusLine = platformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars().getStatusLine

有人知道如何在应用程序工作台Windows Visor外部更新IStatusLineManager

我尝试了以下方法,但它抛出NullPointerException

IStatusLineManager statusLine =  platformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars().getStatusLineManager();
statusLine.setMessage("Test Message");
我甚至试图从以下方面执行它:

display.asyncExec(...)

但是同样的结果:getStatusLineManager()上的NullPointerException

除了少数非常罕见的情况外,
ApplicationWorkbenchWindowVisor
始终是一个单例,因此通常您只需在类中保存一个副本并通过静态方法访问它。

除了少数非常罕见的情况外,
ApplicationWorkbenchWindowVisor
始终是一个单例,因此通常您只需在类中保存一个副本,然后通过静态方法访问它。

我也考虑过这一点,我将以这种方式尝试。但我最好使用一些更智能的解决方案,如服务等。如果可能的话,我只是尝试了你们描述我的方式,它也能工作,但我希望用更优雅的方式,如服务。。别担心,我也想过,我会那样做的。但我最好使用一些更智能的解决方案,如服务等。如果可能的话,我只是尝试了你们描述我的方式,它也能工作,但我希望用更优雅的方式,如服务。。没有关系