![](/img/trans.png)
[英]how to get the views listed in the WorkbenchWindow in RCP application?
[英]Eclipse RCP: How to bring existing WorkbenchWindow to the top?
在我的RCP應用程序中,我創建了多個WorkbenchWindow。 打開多個窗口后,我想以編程方式將其中一個打開。 在我的代碼,我可以找出“ theWindow
”(類型IWorkbenchWindow
),我想這樣做,但我不知道如何把它頂部(設置活躍?)
你能嘗試以下方法嗎?
theWindow.getShell().setFocus();
如果這不起作用,請嘗試在同一個shell上調用forceFocus()
。
感謝Rambler提供forceFocus()的提示,實現這個技巧的實際功能是:
theWindow.getShell().forceActive();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.