简体   繁体   English

以编程方式影响透视图的加载顺序

[英]Programmatically affecting load order of perspectives

So, I'm working on an Eclipse Plugin which includes a custom view based on analysis of source code. 因此,我正在研究一个Eclipse插件,该插件包括一个基于源代码分析的自定义视图。 The majority of the time, it works great. 在大多数时候,它都很棒。 However, if I quit Eclipse with that view open, when I reopen it, it runs into an error with either IWorkbenchWindow.getActivePage() or IWorkbenchPage.getEditorReferences() returning null. 但是,如果我在打开该视图的情况下退出Eclipse,则当我重新打开它时,它会运行IWorkbenchWindow.getActivePage()IWorkbenchPage.getEditorReferences()返回null的错误。 This inconsistency seems to be because the view has the focus when Eclipse quits and is the first thing that Eclipse tries to reconstruct on start up. 这种不一致似乎是因为 在Eclipse退出时视图具有焦点,并且是Eclipse在启动时尝试重建的第一件事。 the focus is on a non-window shell (I don't fully understand this, but that's what this said). 重点是非窗口外壳程序(我不完全理解这一点,但这就是这个意思 )。 Is there a workaround so that I can ensure that Eclipse fully loads its IWorkbenchWindow before my custom plugin regardless of what has the focus when Eclipse closes? 有没有一种解决方法,无论Eclipse关闭时焦点在哪里,我都可以确保在自定义插件之前Eclipse完全加载其IWorkbenchWindow

Thanks 谢谢

您可以考虑改用该网站: getSite().getPage() ...

Tonny Madsen在评论中指出,从View内,我可以从getSite().getPage()访问活动页面,从而解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM