Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Import Preferences
Import Preferences [message #603815] Thu, 17 December 2009 04:12 Go to next message
Cosmin is currently offline CosminFriend
Messages: 23
Registered: October 2009
Junior Member
Hello,

I have a plugin that implements IStartup, and I would like to import some standard preferences on eclipse start.

Here is the code I'm using based on examples from org.eclipse.core.runtime.Preferences :

public final void importDefaultPrefs(String path) {
IPreferencesService prefService = org.eclipse.core.runtime.Platform
.getPreferencesService();
//IPreferencesService prefService = org.eclipse.core.internal.preferences.PreferencesService
// .getDefault();
try {
//Preferences.importPreferences(new Path(path));
prefService.importPreferences(new FileInputStream(new File(path)));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (CoreException e) {
e.printStackTrace();
}
}

But on Eclipse startup I get this error :
Error notifying a preference change listener. Check the log for details.Invalid thread access.
Any idea what I have done wrong or overlooked?

Regards, Cosmin
Re: Import Preferences [message #603819 is a reply to message #603815] Thu, 17 December 2009 13:45 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 17/12/09 9:42 AM, Cosmin wrote:
> But on Eclipse startup I get this error : Error notifying a preference
> change listener. Check the log for details.Invalid thread access. Any
> idea what I have done wrong or overlooked?

Probably one of the listener is trying to access the UI when fired. Do
you have any stack traces?

--
- Prakash
Platform UI Team, IBM

Blog <http://blog.eclipse-tips.com>
Twitter <http://www.twitter.com/Eclipse_Tips>
Previous Topic:Import Preferences
Next Topic:Trouble with headless build since Eclipse 3.5
Goto Forum:
  


Current Time: Tue Apr 23 17:40:22 GMT 2024

Powered by FUDForum. Page generated in 0.03062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top