简体   繁体   English

如何添加首选项页面?

[英]How to add a preference page?

I want to add a preference page in my RCP program, just like you see in the eclipse, when you click Windows->Preferences->General, a preference page appears in the right panel. 我想在我的RCP程序中添加一个首选项页面,就像在日食中看到的那样,当您单击Windows-> Preferences-> General时,右面板中会出现一个首选项页面。 But I'm not familiar about RCP, how can I add a option in the Windows->Preferences lists, and make it work like the "General" option? 但是我对RCP并不熟悉,如何在Windows->“首选项”列表中添加一个选项,并使它像“常规”选项一样工作?

Thanks a lot. 非常感谢。

Open the plugin.xml from the Package explorer and go to Extensions tab. 从Package explorer打开plugin.xml,然后转到Extensions选项卡。 Click add and search for org.eclipse.ui.preferencePage and Finish. 单击添加并搜索org.eclipse.ui.preferencePage和Finish。 Right click on the preferncePage plugin, choose New-->Page. 右键单击preferncePage插件,选择“新建->页面”。 On the right hand side, fill the required fields and save it. 在右侧,填写必填字段并保存。 Run the plugin as an Eclipse application. 将该插件作为Eclipse应用程序运行。 Go to Windows-->Preferences and you will find your custom preference page. 转到Windows->“首选项”,您将找到您的自定义首选项页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM