Q:

How to save custom object for Eclipse Natures Project?

I am working on an Eclipse plugin with a custom project nature. I need to save some custom information about my project into workspace. For example, my project have to use several db connections information, which places in List<DbConfig>. The following is DbConfig class:
public class DbConfig {
    private String dbName;
    private String connectionString;
    private String username;
    private String password;
    //... getters and setters
}

I need somethink like that, but want to put into preferences Object type:
IProject project =  ... get project from selection or something
IScopeContext context = new ProjectScope(project);
Preferences projectPreferences = context.getNode("your nature id");
projectPreferences.put(key, value);
projectPreferences.flush();

In which the object should I place this List and some other preferences?

A:

You can't store objects in the preference store.
You can save any data you like in the 'state location' for your plugin.
Get the state location using:
Bundle bundle = ... your plugin bundle

IPath path = Platform.getStateLocation(bundle);

The returned IPath value will be in the workspace metadata area.
You could use a separate file for each project.
You can get your Bundle using:
Bundle bundle = FrameworkUtil.getBundle(getClass());

or
Bundle bundle = Platform.getBundle("your plugin id");

