java - 如何在 eclipse 4.2 中获取 IEditorReference

标签 java eclipse eclipse-plugin

我有以下代码可以在 eclipse 3.7 中运行:

private static IEditorReference getReference(IEditorPart part) {
        return (IEditorReference) ((PartSite) part.getSite()).getPane().getPartReference();
    }

在 eclipse 4.2 中,我在 getPane() 处收到错误。
应该用什么来代替?

最佳答案

只需执行((PartSite) part.getSite()).getPartReference();

关于java - 如何在 eclipse 4.2 中获取 IEditorReference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11329246/

相关文章:

c++ - Eclipse CDT : Symbol 'cout' could not be resolved

eclipse-plugin - 使用 xtext 的快速修复格式

eclipse-plugin - 如何在 RCP 应用程序中嵌入 Clojure

java - Gradle compileJava 任务警告 : [options] bootstrap class path not set in conjunction with -source 1. 6

java - 如何从 HashMap 中删除值?

java - 坚持使用 Dagger 进行 Activity 的演示者

java - 如何删除eclipse中方法和属性上面的搜索引用链接

java - 如何在不使用 "add"等的情况下在 DAO 中测试 "find"?

android - 从 Eclipse 调试时的 ADB 命令行选项?

android - 使用了不同的 Landroid/support/v4/app/FragmentActivity;预验证期间 : Android + Fragments + JUnit + Maven