【问题标题】:find id of currently selected view in Eclipse RCP application在 Eclipse RCP 应用程序中查找当前选定视图的 ID
【发布时间】:2012-09-27 20:17:26
【问题描述】:

当我的 Eclipse RCP 应用程序运行时,我打开了许多视图。谁能告诉我如何在我的工作台中获取当前选定视图的视图 ID(不是辅助视图 ID)?

【问题讨论】:

    标签: eclipse view swt rcp


    【解决方案1】:

    最后,我有一种方法可以在我的应用程序的工作台中获取当前选定(打开)视图的视图 ID,如下代码行:

    IWorkbenchPage wbp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    String id = wbp.getActivePartReference().getId();
    

    这正是我想要的。

    【讨论】:

      猜你喜欢
      • 2012-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-06
      • 2023-04-07
      • 2010-12-22
      • 1970-01-01
      相关资源
      最近更新 更多