logo       

Re: re: Findbugs 1.1.1 Eclipse Settings: msg#00031

java.findbugs.general

Subject: Re: re: Findbugs 1.1.1 Eclipse Settings

On Fri, 06 Oct 2006 19:20:45 +0200, Eugene Kuleshov <eu@xxxxxxxx> wrote:

Brian,

Can't you just use different strategies for saving settings Eclipse and standalone version? So, you could use Eclipse API to store these settings.
That would resolve potential side effects of these settings getting out of sync, particularly critical for VCS plugins... Otherwise you would have to work around that by explicitly refreshing that file after each update.


I agree with Eugene. Especially the integration with VCS is critical and important thing, which you would get for free, as Eclipse would manage it for you (auto check out on modify, ask user if he would like to checkout etc).

Brian Cole wrote:
[...]
Several of you have mentioned that it should actually be stored in the project's .settings directory. I like that idea, but I'm having trouble finding any Eclipse documentation to corroborate this.[...] Do Eclipse conventions permit the FindBugs plugin to place a custom file in the .settings directory? (I see no API to retrieve the directory or its name, but I could certainly hard-code ".settings" into the path and choose a file name that is unlikely to conflict with anything.) If anyone has links to Eclipse documentation in this area, I'd love to see them. I've had trouble finding decent Eclipse documentation.

FYI, ".settings" directory is defined in org.eclipse.core.internal.preferences.EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME and the custom plugin file name would be automatically created for you by using appropriate API's.

So you do not need to reference/maintain this file manually, because it is done by using ProjectScope class like here:

IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences preferences = projectScope.getNode(YOUR_PLUGIN_ID);
doSomethingOnInitWith(preferences);
preferences.addPreferenceChangeListener(myChangeListener);

If you would prefer not to use Eclipse preferences API, just create .settings/<YOUR_PLUGIN_ID>.prefs file - and if you later decide to move to Eclipse API (you will :), users would not need to change their CVS/whatever settings too :o)

--
Kind regards,
mit freundlichen Grüßen
Andrei Loskutov

@Home: http://andrei.gmxhome.de
Hinweis: diese Nachricht besteht nur aus den wiederverwertbaren Bits.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise