Eclipse 首选项 - 存储位置和方式
我正在开发一个 Eclipse-Plugin,它有自己的首选项页面。
第一个问题:是否可以独立存储这些首选项工作区?相反,我想将其存储起来用于 Eclipse 安装。如果是,怎么办?
第二个问题:我想在我的首选项页面中添加一个表格,其中有一列和每行一个复选框(将行条目标记为活动或非活动)。该列应包含文件位置和/或文本文件的 URL。因此,对于一个首选项设置,我必须存储位置列表以及它是否处于活动状态的信息。哪一个是最好的方法(哪个分隔符?)?
I'm developing an Eclipse-Plugin which has it's own preference page.
First question: Is it possible to store these preferences workspace independent? Instead, I'd like to store it for the Eclipse installation. If yes, how?
Second question: I'd like to add a table to my preference page which has one column and a checkbox for each row (to sign the row entry as active or inactive). The column should contain file locations and/or urls of text files. So for the one preference setting, I'd have to store a list of location and the information whether it's active or not. Which would be the best way (which delimiters?)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Eclipse Preference 服务确实支持首选项存储的范围上下文。您可以将首选项存储在 Eclipse 项目、工作区、实例安装中或自定义范围中。
有关 Eclipse 首选项范围的更多信息,请参阅以下常见问题解答: http://wiki.eclipse.org/FAQ_What_is_a_preference_scope %3F
对于存储您的表格首选项的方式,IMO 没有真正的最佳方法。我想说,您可以使用特定的模式/匹配器将整个表序列化为字符串来解析它。
例如,您可以使用以下格式:
The Eclipse Preference service do support a scope context for the preference store. You can either store preferences in an Eclipse project, in the workspace, in the instance installation or into a custom scope.
Please refer to the following FAQ for more information on Eclipse Preference Scope: http://wiki.eclipse.org/FAQ_What_is_a_preference_scope%3F
For the way to store your table preferences, IMO there is no real best way to do it. I would say that you can serialize the whole table into a string using a specific pattern/matcher to parse it.
For instance, you can use the following format: