Eclipse首选存储持久性 [英] Eclipse Preference store persistance

查看:132
本文介绍了Eclipse首选存储持久性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多用户/位置RCP应用程序,目前使用多个用户可配置的选项。某些偏好是针对电台的,有些是针对用户的。



这些选项来自于将* .prefs文件保存到workspace.metadata .plugins\org.eclipse.core.runtime.settings。



如果我们只使用单个机器/用户,这将很好。但是,如果用户要去另一个电台,那么用户将使用该站设置的任何设置。



是否可以指定另一个窗体对于持久性(而不是文件)?

解决方案

这听起来像您需要将偏好存储在中央位置所有用户/机器都可以达到。这意味着你必须实现自己的 IPersistentPreferencesStore 。然后你可以覆盖 org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()来使用它。



更大的问题是如何实现中央偏好存储,但这取决于您使用的技术。一般来说,如果您的项目使用中央服务器,您可能应该将您的偏好存储在那里。例如,如果您的项目已经使用关系数据库,则一个解决方案是创建适当的数据库表,并实现 IPersistentPreferencesStore 以通过JDBC访问这些表。


I have a multiple user/location RCP application that currently utilizes several user configurable options. Some preferences are for specific to the station, some are specific to the user.

The options are from a preference store which saves the *.prefs files to "workspace.metadata.plugins\org.eclipse.core.runtime.settings".

This would be fine if we were only using a single machine/user. But if a user were to go to another station, then the user would be using whatever preferences were setup for that station.

Is it possible to specify another form for persistence (not files)?

解决方案

It sounds like you need to store your preferences at a central location that all users/machines can reach. This means you have to implement your own IPersistentPreferencesStore. Then you can override org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore() to use it.

The bigger question is how to implement that central preferences store, but that depends on the technologies you are using. In general, if your project uses a central server, you probably should store your preferences there. For example, if your project already uses a relational database, one solution would be to create appropriate database tables and implement IPersistentPreferencesStore to access those tables via JDBC.

这篇关于Eclipse首选存储持久性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆