我需要检查当前活动窗口是否为帮助窗口
有一个org.eclipse.ui.help.IWorkbenchHelpSystem.isContextHelpDisplayed()
方法可以检查上下文相关帮助窗口是否打开,但似乎没有办法检查标准帮助窗口是否打开。有没有办法做到这一点?
答案 0 :(得分:3)
检查一下。
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
IViewReference[] viewReferences = activePage.getViewReferences();
for ( IViewReference iViewReference : viewReferences ) {
if ( iViewReference.getId().equals( "org.eclipse.help.ui.HelpView" ) ) {
// Yay, it's open!
}
}