Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Eclipse中找到首选项页面的首选项页面ID?_Eclipse_Eclipse Plugin - Fatal编程技术网

如何在Eclipse中找到首选项页面的首选项页面ID?

如何在Eclipse中找到首选项页面的首选项页面ID?,eclipse,eclipse-plugin,Eclipse,Eclipse Plugin,我想知道如何在Eclipse中找到现有首选项页面的首选项页面ID。具体来说,我想找出Eclipse中General>Capabilities首选项页面的首选项页面ID。我尝试过“org.eclipse.ui.activities.ActivityCategoryPreferencePage”,但似乎不起作用 谢谢 我发现的最简单的方法是,假设您将PDE作为eclipse安装的一部分,使用Plugin Spy并从那里开始 打开首选项页面并按Alt+Shift+F1。应出现“插件选择间谍”对话框。在

我想知道如何在Eclipse中找到现有首选项页面的首选项页面ID。具体来说,我想找出Eclipse中General>Capabilities首选项页面的首选项页面ID。我尝试过“org.eclipse.ui.activities.ActivityCategoryPreferencePage”,但似乎不起作用


谢谢

我发现的最简单的方法是,假设您将PDE作为eclipse安装的一部分,使用Plugin Spy并从那里开始

打开首选项页面并按Alt+Shift+F1。应出现“插件选择间谍”对话框。在该对话框中,您将找到活动页面的贡献插件和类名。然后转到该插件并查看其plugin.xml以查找ID

请注意,某些实现可能将ID作为查看器类中的常量,因此您可以从查看类的代码开始,如果没有,请检查plugin.xml


Cheers

我在命令处理程序中编写了一些代码,以查找所有首选项页面标签及其ID。但是,该站点上的代码仅打印出最高级别的首选项节点;而我想要的页面作为顶级通用(org.eclipse.ui.preferencePages.Workbench)首选项页面的子页面存在。因此,我稍微修改了代码,将子项打印为ewll

    PreferenceManager pm = PlatformUI.getWorkbench( ).getPreferenceManager();
    List<IPreferenceNode> l = pm.getElements(PreferenceManager.PRE_ORDER);

    for(IPreferenceNode node : l){
        System.out.println("Label:" + node.getLabelText() + " ID:" + node.getId());
    }
PreferenceManager pm=PlatformUI.getWorkbench().getPreferenceManager();
列表l=pm.getElements(PreferenceManager.PRE_ORDER);
对于(IPreferenceNode:l){
System.out.println(“Label:+node.getLabelText()+”ID:+node.getId());
}

这会打印出所有首选页面的名称和ID,然后我只需搜索我想要的标签。

感谢您为我指明了方向;plugin spy说贡献插件是“org.eclipse.ui.workbench”,活动页面类是“ActivityCategoryPreferencePage”。但是,该类不包含关于ID的任何信息,org.eclipse.ui.workbench的plugin.xml也不包含任何信息(它只有几行声明首选项初始值设定项类)