我目前正在构建一个基于 Eclipse 的 RCP 应用程序。 在我的一个插件中,我通过代码添加了两个 View :
layout.addView("dev.asd.tableviewer.tree", IPageLayout.LEFT, 0.25f, IPageLayout.ID_EDITOR_AREA);
layout.addView("dev.asd.tableviewer.view", IPageLayout.RIGHT, 0.75f, IPageLayout.ID_EDITOR_AREA);
第一个 View 包含一个树查看器,第二个包含一个表格查看器。现在我想根据 treeviewer 的选择更新 tableviewer 的内容。我的问题是,如何从 treeviewer 中引用 tableviewer?或者有其他方法可以解决这个问题吗?
最佳答案
使用 SelectionService 解决这个问题。不需要引用 View ,请参阅 http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html
关于eclipse-plugin - Eclipse RCP 让两个 View 进行通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4832551/