eclipse preference plugin development store and get

eclipse plugin development:

 

E:\workspaces\Eclipse_workspace_rcp\.metadata\.plugins\org.eclipse.pde.core\Eclipse Application

 

set the preferencestore in where:

setPreferenceStore(Activator.getDefault().getPreferenceStore());

 

eclipse build

假设你的插件已经开发完毕,剩下打包了,请在此之前确认以下事项;

程序中需要加入的第三方Jar包,不能自己在 Build Path 中手动加入, 必须使用下面的方法. 
     其他的第三方 Jar 包 (包括 Classpath) Runtime -> Classpath -> Add(New)

c493d3d8-1c69-3068-bf5e-359b60de02ea.jpg 

 

http://blog.csdn.net/jimesum1/article/details/2413010

 

http://www.cnblogs.com/decarl/archive/2012/05/15/2502084.html

 

设置的值会保存到
runtime-myDesigner.product\.metadata\.plugins\org.eclipse.core.runtime\.settings中会生成文件

E:\workspaces\runtime-EclipseApplication\.metadata\.plugins\org.eclipse.core.runtime\.settings\com.geee.cucumber.pref

 image

BEST DOCUMENT:

http://demo.netfoucs.com/luoww1/article/details/34425305

image

复制代码
//将用户引导至首选项配置页面         
PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();          
Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();          
PreferenceDialog pd = new PreferenceDialog(parentShell, manager);        
pd.setSelectedNode("com.workflow.preferences.page.DBPreferencePage");
//设置选中的页面  (org.eclipse.ui.preferencePages 扩展点中page的ID)       
 pd.open();  



PreferencesUtil.createPreferenceDialogOn(
new Shell(),
"com.workflow.preferences.page.DBPreferencePage", 
new String[]{"com.workflow.preferences.page.WorkFlowBasePreferencePage","com.workflow.preferences.page.DBPreferencePage"}, null).open(); 

//上面的new string 数组参数主要定义左边显示哪些首页项节点栏,若为null,就显示所有的所选项
复制代码

 

  1. preference for plugin store in this place for every store key:

E:\workspaces\runtime-EclipseApplication\.metadata\.plugins\org.eclipse.core.runtime\.settings\

like below:

choicePreference=choice1
eclipse.preferences.version=1
stringPreference=3333333333

 

2. then we set the default store value .

3.createContent should  set these stored value

4.performOK and performApply to set the value.


本文转自hcy's workbench博客园博客,原文链接:http://www.cnblogs.com/alterhu/p/3999205.html,如需转载请自行联系原作者。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值