Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Preference store persistance

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

like image 962
TJR Avatar asked Oct 08 '09 18:10

TJR


1 Answers

According the the eclipse wiki, the preferences are file-based, and stored:

  • for each installation (but this may vary for multi-user installations), in files stored in <eclipse_home>/eclipse/configuration/.settings/.
    There is typically one file per plugin, with a .prefs extension.
    Note that very few plug-ins use installation-wide preferences.
  • for each workspace, in files stored in <workspace>/.metadata/.plugin/org.eclipse.core.runtime/.settings.
    There is typically one file per plugin, with a .prefs extension.
  • for each project --for project-level settings -- in files stored in a .settings sub-directory of your project folder

So if the file option is here to stay, you may need to:

  • either export/reimport the session settings manually in a user-specific directory (tedious)
  • or make some kind of automated mechanism:
    • to export the settings to the user's registry (HKEY_CURRENT_USER/Software/MyRCP/...) at the exit of the application, and
    • to import them by reading those registry keys and overriding the .prefs files in the local workspace.metadata.plugins\org.eclipse.core.runtime.settings directory
  • or share those settings through some kind of user-specific link (a wrapper around the startup of the RCP would be in charge of making the right link, even on Windows with junctions for instance)
like image 123
VonC Avatar answered Oct 12 '22 11:10

VonC