代码之家  ›  专栏  ›  技术社区  ›  fx88

在Eclipse RCP-包/项目演示文稿中修改项目资源管理器

  •  0
  • fx88  · 技术社区  · 7 年前

    我有一个Eclipse RCP项目,它使用项目浏览器作为默认导航器。对于此项目资源管理器,我想将项目和包演示文稿hirarchical设置为默认值。是否有任何方法或扩展点可以为启动设置这些值?

    1 回复  |  直到 7 年前
        1
  •  0
  •   fx88    7 年前

    我通过设置提供插件的首选项找到了解决方案:

    IEclipsePreferences workbenchPrefs = InstanceScope.INSTANCE.getNode("org.eclipse.ui.workbench");
        workbench.putBoolean("org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState", true);
    
        IEclipsePreferences jdtPrefs = InstanceScope.INSTANCE.getNode("org.eclipse.jdt.ui");
        jdtPrefs.putInt("org.eclipse.jdt.internal.ui.navigator.layout", 1);
    

    在这个集合中,包和项目表示在启动时都更改为hirarchical。