Antje Janosch
Antje Janosch

Reputation: 1194

eclipse preference - where and how to store

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?)?

Upvotes: 3

Views: 1448

Answers (1)

greydet
greydet

Reputation: 5539

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:

your.table.preference=(url1,boolean);(url2,boolean);(url3,boolean)

Upvotes: 2

Related Questions